extern const char *PRIVS_OSP[];
extern const char *PRIVS_EFL[];
-extern const char* PRIV_APPSETTING[];
extern const char* PRIVS_AV[];
+extern const char *PRIV_APPSETTING[];
+extern const char *PRIV_APPSETTING_RULES[];
typedef std::vector< std::vector<std::string> > rules_t;
const char *PRIVS_OSP[] = { "test_privilege_control_rules_osp", NULL };
const char *PRIVS_EFL[] = { "test_privilege_control_rules_efl", NULL };
-const char* PRIV_APPSETTING[] {"org.tizen.privilege.appsetting", NULL};
-
const char* PRIVS_AV[] = { "org.tizen.privilege.antivirus", NULL };
+const char *PRIV_APPSETTING[] {"org.tizen.privilege.appsetting", NULL};
+const char *PRIV_APPSETTING_RULES[] = { "~APP~ ~SETTINGS_PATH~ rwx",
+ "~APP~ ~ALL_APPS~ rx",
+ NULL};
/**
* Check if every rule is true.
* @return 1 if ALL rules in SMACK, 0 if ANY rule isn't, -1 on failure
ret = perm_app_install(APP_TEST);
RUNNER_ASSERT_MSG_BT(ret == PC_OPERATION_SUCCESS, "Error in perm_app_install.");
+ //register appsettings feature
+ ret = perm_add_api_feature(APP_TYPE_OSP, PRIV_APPSETTING[0], PRIV_APPSETTING_RULES, NULL, 0);
+ RUNNER_ASSERT_MSG_BT(ret == PC_OPERATION_SUCCESS,
+ " Error registering api feature. Result: " << ret);
ret = perm_app_enable_permissions(APP_TEST, APP_TYPE_OSP, PRIV_APPSETTING, true);
RUNNER_ASSERT_MSG_BT(ret == PC_OPERATION_SUCCESS,
result = perm_app_install(APP_TEST_SETTINGS_ASP1);
RUNNER_ASSERT_MSG_BT(result == PC_OPERATION_SUCCESS,
"Error in perm_app_install. Result: " << result);
+
+ // Register appsettings feature
+ result = perm_add_api_feature(APP_TYPE_OSP, PRIV_APPSETTING[0], PRIV_APPSETTING_RULES, NULL, 0);
+ RUNNER_ASSERT_MSG_BT(result == PC_OPERATION_SUCCESS,
+ " Error while registering api feature. Result: " << result);
+
result = perm_app_enable_permissions(APP_TEST_SETTINGS_ASP1,
APP_TYPE_OSP, PRIV_APPSETTING, true);
RUNNER_ASSERT_MSG_BT(result == PC_OPERATION_SUCCESS,
RUNNER_ASSERT_MSG_BT(result == PC_OPERATION_SUCCESS,
"Error in perm_app_install."
<< " Result: " << result);
+
+ // Register appsettings feature
+ result = perm_add_api_feature(APP_TYPE_OSP, PRIV_APPSETTING[0], PRIV_APPSETTING_RULES, NULL, 0);
+ RUNNER_ASSERT_MSG_BT(result == PC_OPERATION_SUCCESS,
+ " Error while registering api feature. Result: " << result);
+
result = perm_app_enable_permissions(APP_TEST_SETTINGS_ASP1,
APP_TYPE_OSP, PRIV_APPSETTING, true);
RUNNER_ASSERT_MSG_BT(result == PC_OPERATION_SUCCESS,