Add rule file path getters to PolicyConfiguration
[platform/core/test/security-tests.git] / src / security-manager-tests / common / policy_configuration.h
index 6062e73..f807411 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2016-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.
@@ -31,6 +31,7 @@ public:
     typedef std::vector<gid_t> GidVector;
     typedef std::vector<std::string> GroupVector;
     typedef std::vector<std::string> PrivVector;
+    typedef std::map<std::string, std::string> PrivGroupMap;
 
     struct UserDescription {
         PrivVector privVector;
@@ -48,17 +49,21 @@ public:
     GroupVector getGroup();
     UserDescription& getUserDescription(UserType userType);
     gid_t groupToGid(const std::string &gname);
+    PrivGroupMap getPrivGroupMap();
+    PrivVector getSystemdManagedPrivs();
+    GroupVector privToGroup(const PrivVector &privVector);
+    GidVector groupToGid(const GroupVector &groupVector);
 
-static bool getIsAskuserEnabled();
+    static bool getIsAskuserEnabled();
+    static std::string getPkgRulesFilePath();
+    static std::string getAppRulesFilePath();
 
 private:
-    GidVector groupToGid(const GroupVector &groupVector);
     UserDescription loadUserDescription(UserType userType);
     PrivVector loadPrivFile(const std::string &path);
-    GroupVector privToGroup(const PrivVector &privVector);
     void loadPrivGroupMap(void);
 
-    std::map<std::string, std::string> m_privGroupMap;
+    PrivGroupMap m_privGroupMap;
     std::map<std::string, gid_t> m_groupGidMap;
     std::map<UserType, UserDescription> m_userDescriptionMap;
 };