typedef struct {
uam_request_e request;
- int priv_level;
+ int privilege_type;
int function_type;
} uam_request_table_s;
static uam_request_table_s request_table[] = {
- { UAM_REQUEST_GET_AVAILABLE_SENSORS, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_IS_SENSOR_READY, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_GET_DEFAULT_USER, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_ADD_USER, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_DELETE_USER, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_UPDATE_USER, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_GET_USER_BY_ACCOUNT, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_GET_USER_BY_DEVICE_ID, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_GET_USER_BY_MAC, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_GET_USERS, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_ADD_DEVICE, UAM_PRIVLEVEL_PUBLIC, UAM_ASYNC_FUNCTION },
- { UAM_REQUEST_DELETE_DEVICE, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_UPDATE_DEVICE, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_DELETE_DEVICE_BY_DEVICE_ID, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_DELETE_DEVICE_BY_MAC, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_GET_DEVICE_BY_DEVICE_ID, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_GET_DEVICE_BY_MAC, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_GET_DEVICES, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_GET_USER_DEVICES, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_IS_DEVICE_ADDED, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_SET_DETECTION_THRESHOLD, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_START_PRESENCE_DETECTION, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_STOP_PRESENCE_DETECTION, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_START_ABSENCE_DETECTION, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_STOP_ABSENCE_DETECTION, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_SET_LOW_POWER_MODE, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_START_SEARCH_ACTIVE_DEVICES, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_STOP_SEARCH_ACTIVE_DEVICES, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_REGISTER_APP, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_DEREGISTER_APP, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_ADD_USER_TO_SERVICE, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_REMOVE_USER_FROM_SERVICE, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_ADD_DEVICE_TO_SERVICE, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_REMOVE_DEVICE_FROM_SERVICE, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_SET_DEVICE_SERVICES_DISCRIMINANT, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_GET_DEVICE_SERVICES_DISCRIMINANT, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_GET_DEVICE_SERVICES_LAST_SEEN, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_SET_SERVICE_DETECTION_CYCLE, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_GET_SERVICE_DETECTION_CYCLE, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_GET_DETECTION_WINDOW, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_SET_DETECTION_WINDOW, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_RESET_DB, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_GET_DEFAULT_SERVICE, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_REGISTER_SERVICE, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_UPDATE_SERVICE, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_UNREGISTER_SERVICE, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_GET_SERVICE_DEVICES, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_GET_SERVICE_USERS, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_GET_SERVICES, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_ADD_IBEACON_ADV, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_ADD_PAYLOAD, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_ADD_PAYLOAD_TO_SERVICE, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
- { UAM_REQUEST_GET_PAYLOADS, UAM_PRIVLEVEL_PUBLIC, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_GET_AVAILABLE_SENSORS, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_IS_SENSOR_READY, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_GET_DEFAULT_USER, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_ADD_USER, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_DELETE_USER, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_UPDATE_USER, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_GET_USER_BY_ACCOUNT, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_GET_USER_BY_DEVICE_ID, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_GET_USER_BY_MAC, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_GET_USERS, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_ADD_DEVICE, UAM_PRIVTYPE_DEVICE, UAM_ASYNC_FUNCTION },
+ { UAM_REQUEST_DELETE_DEVICE, UAM_PRIVTYPE_DEVICE, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_UPDATE_DEVICE, UAM_PRIVTYPE_DEVICE, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_DELETE_DEVICE_BY_DEVICE_ID, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_DELETE_DEVICE_BY_MAC, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_GET_DEVICE_BY_DEVICE_ID, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_GET_DEVICE_BY_MAC, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_GET_DEVICES, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_GET_USER_DEVICES, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_IS_DEVICE_ADDED, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_SET_DETECTION_THRESHOLD, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_START_PRESENCE_DETECTION, UAM_PRIVTYPE_DEVICE | UAM_PRIVTYPE_LOCATION, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_STOP_PRESENCE_DETECTION, UAM_PRIVTYPE_DEVICE | UAM_PRIVTYPE_LOCATION, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_START_ABSENCE_DETECTION, UAM_PRIVTYPE_DEVICE | UAM_PRIVTYPE_LOCATION, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_STOP_ABSENCE_DETECTION, UAM_PRIVTYPE_DEVICE | UAM_PRIVTYPE_LOCATION, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_SET_LOW_POWER_MODE, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_START_SEARCH_ACTIVE_DEVICES, UAM_PRIVTYPE_DEVICE | UAM_PRIVTYPE_LOCATION, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_STOP_SEARCH_ACTIVE_DEVICES, UAM_PRIVTYPE_DEVICE | UAM_PRIVTYPE_LOCATION, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_REGISTER_APP, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_DEREGISTER_APP, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_ADD_USER_TO_SERVICE, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_REMOVE_USER_FROM_SERVICE, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_ADD_DEVICE_TO_SERVICE, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_REMOVE_DEVICE_FROM_SERVICE, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_SET_DEVICE_SERVICES_DISCRIMINANT, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_GET_DEVICE_SERVICES_DISCRIMINANT, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_GET_DEVICE_SERVICES_LAST_SEEN, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_SET_SERVICE_DETECTION_CYCLE, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_GET_SERVICE_DETECTION_CYCLE, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_GET_DETECTION_WINDOW, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_SET_DETECTION_WINDOW, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_RESET_DB, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_GET_DEFAULT_SERVICE, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_REGISTER_SERVICE, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_UPDATE_SERVICE, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_UNREGISTER_SERVICE, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_GET_SERVICE_DEVICES, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_GET_SERVICE_USERS, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_GET_SERVICES, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_ADD_IBEACON_ADV, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_ADD_PAYLOAD, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_ADD_PAYLOAD_TO_SERVICE, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_GET_PAYLOADS, UAM_PRIVTYPE_NA, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_ADD_SENSOR, UAM_PRIVTYPE_DEVICE, UAM_SYNC_FUNCTION },
+ { UAM_REQUEST_REMOVE_SENSOR, UAM_PRIVTYPE_DEVICE, UAM_SYNC_FUNCTION },
};
#define UAM_ASYNC_REQUEST_TIMEOUT 11 /* 11 sec */
}
break;
}
+ case UAM_REQUEST_ADD_SENSOR:
+ case UAM_REQUEST_REMOVE_SENSOR:
+ result = UAM_ERROR_NONE;
+ break;
default:
UAM_WARN("UnSupported function [%s(0x%4.4X)]",
_uam_manager_request_to_str(function), function);
return request_table[function].function_type;
}
-static int __uam_manager_get_priv_level(int function)
+static int __uam_manager_get_privilege_type(int function)
{
- return request_table[function].priv_level;
+ return request_table[function].privilege_type;
}
-gboolean __uam_manager_check_privilege(int function,
- const char *unique_name)
+static unsigned int __uam_manager_get_device_type(
+ int function,
+ GVariant *in_param1,
+ GVariant *in_param2,
+ GVariant *in_param3,
+ GVariant *in_param4)
+{
+ unsigned int device_type = 0;
+
+ switch (function) {
+ case UAM_REQUEST_ADD_SENSOR:
+ case UAM_REQUEST_REMOVE_SENSOR: {
+ unsigned int bitmask;
+
+ __uam_manager_copy_params(in_param1,
+ &bitmask, sizeof(unsigned int));
+
+ if (bitmask == UAM_SENSOR_BITMASK_BT ||
+ bitmask == UAM_SENSOR_BITMASK_BLE) {
+ device_type = UAM_SENSOR_BITMASK_BT;
+ } else if (bitmask == UAM_SENSOR_BITMASK_WIFI) {
+ device_type = UAM_SENSOR_BITMASK_WIFI;
+ }
+
+ break;
+ }
+ case UAM_REQUEST_ADD_DEVICE:
+ case UAM_REQUEST_DELETE_DEVICE:{
+ uam_device_info_s dev_info;
+
+ __uam_manager_copy_params(in_param2,
+ &dev_info, sizeof(uam_device_info_s));
+
+ if (dev_info.type == UAM_TECH_TYPE_BT ||
+ dev_info.type == UAM_TECH_TYPE_BLE) {
+ device_type = UAM_TECH_TYPE_BT;
+ } else if (dev_info.type == UAM_TECH_TYPE_WIFI) {
+ device_type = UAM_TECH_TYPE_WIFI;
+ }
+
+ break;
+ }
+ case UAM_REQUEST_UPDATE_DEVICE: {
+ uam_device_info_s dev_info;
+
+ __uam_manager_copy_params(in_param1,
+ &dev_info, sizeof(uam_device_info_s));
+
+ if (dev_info.type == UAM_TECH_TYPE_BT ||
+ dev_info.type == UAM_TECH_TYPE_BLE) {
+ device_type = UAM_TECH_TYPE_BT;
+ } else if (dev_info.type == UAM_TECH_TYPE_WIFI) {
+ device_type = UAM_TECH_TYPE_WIFI;
+ }
+
+ break;
+ }
+ case UAM_REQUEST_START_SEARCH_ACTIVE_DEVICES:
+ case UAM_REQUEST_STOP_SEARCH_ACTIVE_DEVICES:
+ case UAM_REQUEST_START_PRESENCE_DETECTION:
+ case UAM_REQUEST_STOP_PRESENCE_DETECTION:
+ case UAM_REQUEST_START_ABSENCE_DETECTION:
+ case UAM_REQUEST_STOP_ABSENCE_DETECTION: {
+ unsigned int bitmask = 0;
+
+ __uam_manager_copy_params(in_param1,
+ &bitmask, sizeof(unsigned int));
+
+ if (bitmask == UAM_SENSOR_BITMASK_BT ||
+ bitmask == UAM_SENSOR_BITMASK_BLE) {
+ device_type = UAM_SENSOR_BITMASK_BT;
+ } else if (bitmask == UAM_SENSOR_BITMASK_WIFI) {
+ device_type = UAM_SENSOR_BITMASK_WIFI;
+ }
+
+ break;
+ }
+ default :
+ device_type = 0;
+ break;
+ }
+
+ return device_type;
+}
+
+static gboolean __uam_manager_check_cynara(
+ char *client_creds,
+ char *client_session,
+ char *user_creds,
+ const char *privilege)
+{
+ int ret;
+
+ if (privilege) {
+ ret = cynara_check(p_cynara, client_creds,
+ client_session, user_creds, privilege);
+ if (ret != CYNARA_API_ACCESS_ALLOWED) {
+ UAM_ERR("Access denied: %s", privilege);
+ return FALSE;
+ }
+
+ UAM_INFO("[%s][%s]", client_creds, privilege);
+ }
+
+ return TRUE;
+}
+
+static gboolean __uam_manager_check_privilege(
+ const char *unique_name,
+ int function,
+ GVariant *in_param1,
+ GVariant *in_param2,
+ GVariant *in_param3,
+ GVariant *in_param4)
{
- int ret_val;
gboolean result = TRUE;
char *client_creds = NULL;
char *user_creds = NULL;
char *client_session = "";
+ unsigned int device_type = 0;
+ char *device_privilege = NULL;
+ char *location_privilege = NULL;
retv_if(unique_name == NULL, FALSE);
return FALSE;
}
- UAM_DBG("%s, %s, %s", unique_name, client_creds, user_creds);
+ if (UAM_PRIVTYPE_DEVICE == __uam_manager_get_privilege_type(function)) {
+ device_type = __uam_manager_get_device_type(function,
+ in_param1, in_param2, in_param3, in_param4);
+ if (device_type == UAM_TECH_TYPE_BT)
+ device_privilege = UAM_PRIVILEGE_BLUETOOTH;
+ else if (device_type == UAM_TECH_TYPE_WIFI)
+ device_privilege = UAM_PRIVILEGE_NETWORK;
+ } else if ((UAM_PRIVTYPE_DEVICE | UAM_PRIVTYPE_LOCATION)
+ == __uam_manager_get_privilege_type(function)) {
+ device_type = __uam_manager_get_device_type(function,
+ in_param1, in_param2, in_param3, in_param4);
+ if (device_type == UAM_TECH_TYPE_BT)
+ device_privilege = UAM_PRIVILEGE_BLUETOOTH;
+ else if (device_type == UAM_TECH_TYPE_WIFI)
+ device_privilege = UAM_PRIVILEGE_NETWORK;
- if (UAM_PRIVLEVEL_PUBLIC == __uam_manager_get_priv_level(function)) {
- ret_val = cynara_check(p_cynara, client_creds,
- client_session, user_creds, UAM_PRIVILEGE_PUBLIC);
+ /* TODO: It will be added in later
+ location_privilege = UAM_PRIVILEGE_LOCATION;
+ */
+ }
- UAM_INFO("Client Credentials [%s]", client_creds);
- if (ret_val != CYNARA_API_ACCESS_ALLOWED) {
- UAM_ERR("Fail to access: %s", UAM_PRIVILEGE_PUBLIC);
- result = FALSE;
- }
- } else {
- ret_val = cynara_check(p_cynara, client_creds,
- client_session, user_creds, UAM_PRIVILEGE_PLATFORM);
+ if (!(result = __uam_manager_check_cynara(client_creds,
+ client_session, user_creds, device_privilege)))
+ goto done;
- if (ret_val != CYNARA_API_ACCESS_ALLOWED) {
- UAM_ERR("Fail to access: %s", UAM_PRIVILEGE_PLATFORM);
- result = FALSE;
- }
- }
+ if (!(result = __uam_manager_check_cynara(client_creds,
+ client_session, user_creds, location_privilege)))
+ goto done;
+done:
g_free(client_creds);
g_free(user_creds);
out_param1 = g_array_new(FALSE, FALSE, sizeof(gchar));
- if (__uam_manager_check_privilege(function, (const char *)sender) == FALSE) {
+ if (__uam_manager_check_privilege((const char *)sender, function,
+ in_param1, in_param2, in_param3, in_param4) == FALSE) {
UAM_ERR("Client don't have the privilege to excute this function");
/* TODO:
result = UAM_ERROR_PERMISSION_DENIED;