Unify privilege representation
[platform/core/test/security-tests.git] / src / common / app_def_privilege.h
index d399dac..40d1d46 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014-2018 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2014-2020 Samsung Electronics Co., Ltd All Rights Reserved
  *
  *    Licensed under the Apache License, Version 2.0 (the "License");
  *    you may not use this file except in compliance with the License.
@@ -32,6 +32,12 @@ public:
         PRIVACY,
     };
 
+    Privilege(const char* systemPrivilege, Type type = UNSET, std::string license = std::string())
+      : m_name(systemPrivilege)
+      , m_type(type)
+      , m_license(std::move(license))
+    {}
+
     Privilege(std::string systemPrivilege, Type type = UNSET, std::string license = std::string())
       : m_name(std::move(systemPrivilege))
       , m_type(type)
@@ -66,6 +72,8 @@ public:
 
     operator std::string() const { return m_name; }
 
+    bool operator==(const std::string& other) const { return m_name == other; }
+
 private:
     std::string m_name;
     Type m_type;