DEFINE_SMARTPTR(tzplatform_context_destroy, tzplatform_context, TzPlatformContextPtr);
static const privileges_t SM_ALLOWED_PRIVILEGES = {
- "http://tizen.org/privilege/location",
+ "http://tizen.org/privilege/display",
"http://tizen.org/privilege/nfc"
};
static const std::vector<privileges_t> MANY_APPS_PRIVILEGES = {
{
"http://tizen.org/privilege/internet",
- "http://tizen.org/privilege/location"
+ "http://tizen.org/privilege/display"
},
{
"http://tizen.org/privilege/telephony",
- "http://tizen.org/privilege/camera"
+ "http://tizen.org/privilege/datasharing"
},
{
- "http://tizen.org/privilege/contact.read",
+ "http://tizen.org/privilege/content.write",
"http://tizen.org/privilege/led",
"http://tizen.org/privilege/email"
},
"http://tizen.org/privilege/led",
"http://tizen.org/privilege/email",
"http://tizen.org/privilege/telephony",
- "http://tizen.org/privilege/camera"
+ "http://tizen.org/privilege/datasharing"
},
{
"http://tizen.org/privilege/internet",
- "http://tizen.org/privilege/location",
+ "http://tizen.org/privilege/display",
"http://tizen.org/privilege/led",
"http://tizen.org/privilege/email"
}
PolicyEntry filter;
PolicyRequest policyRequest;
- //this call should succeed as the calling user is privileged
- Api::getPolicyForSelf(filter, policyEntries);
-
- RUNNER_ASSERT_MSG(policyEntries.size() == 0, "Policy is not empty");
PolicyEntry policyEntry(
MANY_APPS[0],
policyEntry = PolicyEntry(
MANY_APPS[1],
std::to_string(pw->pw_uid),
- "http://tizen.org/privilege/location"
+ "http://tizen.org/privilege/display"
);
policyEntry.setLevel("Deny");
policyRequest.addEntry(policyEntry);
Api::sendPolicy(policyRequest);
- Api::getPolicyForSelf(filter, policyEntries);
- RUNNER_ASSERT_MSG(policyEntries.size() == 2, "Number of policies doesn't match - should be: 2 and is " << policyEntries.size());
exit(0);
} else { //parent process
sync[0].claimParentEp();
//U2 requests contents of U1 privacy manager - should fail
Api::getPolicyForSelf(filter, policyEntries);
- RUNNER_ASSERT_MSG(policyEntries.size() == 0, "Policy is not empty");
+ RUNNER_ASSERT_MSG(policyEntries.size() == 0, "Policy is not empty, but is " << policyEntries.size());
filter = PolicyEntry(
SECURITY_MANAGER_ANY,
//U2 requests contents of ADMIN bucket - should fail
Api::getPolicyForAdmin(filter, policyEntries, SECURITY_MANAGER_ERROR_ACCESS_DENIED);
- RUNNER_ASSERT_MSG(policyEntries.size() == 0, "Policy is not empty");
+ RUNNER_ASSERT_MSG(policyEntries.size() == 0, "Policy is not empty, but is " << policyEntries.size());
exit(0);
} else { //parent
sync[1].claimParentEp();
//this call should succeed as the calling user is privileged
Api::getPolicyForSelf(filter, policyEntries);
- RUNNER_ASSERT_MSG(policyEntries.size() == 0, "Policy is not empty");
+ unsigned int policyNum = policyEntries.size();
PolicyEntry policyEntry(
SECURITY_MANAGER_ANY,
policyEntry = PolicyEntry(
SECURITY_MANAGER_ANY,
SECURITY_MANAGER_ANY,
- "http://tizen.org/privilege/location"
+ "http://tizen.org/privilege/display"
);
policyEntry.setMaxLevel("Deny");
Api::sendPolicy(*policyRequest);
Api::getPolicyForAdmin(filter, policyEntries);
- RUNNER_ASSERT_MSG(policyEntries.size() == 2, "Number of policies doesn't match - should be: 2 and is " << policyEntries.size());
+ RUNNER_ASSERT_MSG(policyEntries.size() == policyNum + 2, "Number of policies doesn't match - should be: "
+ << policyNum + 2 << " and is " << policyEntries.size());
delete policyRequest;
policyRequest = new PolicyRequest();
policyEntry = PolicyEntry(
SECURITY_MANAGER_ANY,
SECURITY_MANAGER_ANY,
- "http://tizen.org/privilege/location"
+ "http://tizen.org/privilege/display"
);
policyEntry.setMaxLevel(SECURITY_MANAGER_DELETE);
result = drop_root_privileges(msg.uid, msg.gid);
RUNNER_ASSERT_MSG(result == 0, "drop_root_privileges failed");
- // without plugins there should only be 2 policies - Allow and Deny
+ // 3 should be there when ask-user is installed
ret = security_manager_policy_levels_get(&levels, &count);
RUNNER_ASSERT_MSG((lib_retcode)ret == SECURITY_MANAGER_SUCCESS,
"Invlid return code: " << ret);
- RUNNER_ASSERT_MSG(count == 2, "Invalid number of policy levels. Should be 2, instead there is: " << static_cast<int>(count));
+ RUNNER_ASSERT_MSG(count == 3, "Invalid number of policy levels. Should be 3, instead there is: " << static_cast<int>(count));
deny_policy = std::string(levels[0]);
allow_policy = std::string(levels[count-1]);
PRIVILEGE_MANAGER_ADMIN_PRIVILEGE};
privileges_t manifest_privs = {
"http://tizen.org/privilege/internet",
- "http://tizen.org/privilege/camera"};
- privileges_t real_privs_allow = {"http://tizen.org/privilege/camera"};
+ "http://tizen.org/privilege/datasharing"};
+ privileges_t real_privs_allow = {"http://tizen.org/privilege/datasharing"};
privileges_t real_privs_deny = {"http://tizen.org/privilege/internet"};
const std::string pirivman_id = "sm_test_13_ADMIN_APP";