Change privacy privilege check 29/243729/1
authorYunjin Lee <yunjin-.lee@samsung.com>
Wed, 9 Sep 2020 10:28:49 +0000 (19:28 +0900)
committerYunjin Lee <yunjin-.lee@samsung.com>
Wed, 9 Sep 2020 10:28:49 +0000 (19:28 +0900)
- Use privilege_info_has_privacy_attr() instead of
privilege_info_is_privacy() to see if the given privilege is privacy
related or not regardless of the askuser enabled or not.

Change-Id: I34d3652c21fe52f18e048b39dfa73667e2841d38
Signed-off-by: Yunjin Lee <yunjin-.lee@samsung.com>
src/privilege_information.c

index 095bdc84614ddd00023f4ce1c07a919eed47e8ec..6de2c21ee3d1a9f381408e8b19ef5c09ed25db3a 100755 (executable)
@@ -145,7 +145,7 @@ int privilege_info_get_privacy_display_name(const char *privilege, char **privac
 {
        CHECK_FEATURE_SUPPORTED(PRIVACY_FEATURE);
        TryReturn(privilege != NULL, , PRVINFO_ERROR_INVALID_PARAMETER, "[PRVINFO_ERROR_INVALID_PARAMETER] privilege is NULL");
-       TryReturn(privilege_info_is_privacy(privilege) == 1, , PRVINFO_ERROR_INVALID_PARAMETER, "[PRVINFO_ERROR_INVALID_PARAMETER] privilege does not exist or is not a privacy related");
+       TryReturn(privilege_info_has_privacy_attr(privilege) == 1, , PRVINFO_ERROR_INVALID_PARAMETER, "[PRVINFO_ERROR_INVALID_PARAMETER] privilege %s does not exist or does not have privacy attribute", privilege);
 
        char* privacy_name = NULL;
        TryReturn(privilege_info_get_privacy_by_privilege(privilege, &privacy_name) == PRVMGR_ERR_NONE && privacy_name != NULL, SAFE_FREE(privacy_name), PRVINFO_ERROR_INTERNAL_ERROR, "[PRVINFO_ERROR_INTERNAL_ERROR] privilege_info_get_privacy_by_privilege() failed. privilege = %s", privilege);