Modify to check privilege 69/255969/2 accepted/tizen/unified/20210331.054046 submit/tizen/20210330.060456
authorhyunuk.tak <hyunuk.tak@samsung.com>
Thu, 25 Mar 2021 23:37:44 +0000 (08:37 +0900)
committerhyunuk.tak <hyunuk.tak@samsung.com>
Tue, 30 Mar 2021 04:24:12 +0000 (13:24 +0900)
Change privilege as below
userawareness, userawareness.admin
=> bluetooth, network.get, location

Add request for adding/removing sensor

Change-Id: Iedd72ba46ac0a93b1ba320f637a9b0aa464686d1
Signed-off-by: hyunuk.tak <hyunuk.tak@samsung.com>
include/ua-api.h [changed mode: 0644->0755]
include/ua-internal.h [changed mode: 0644->0755]
ua-api/src/ua-api.c [changed mode: 0644->0755]
ua-daemon/include/ua-manager-common.h [changed mode: 0644->0755]
ua-daemon/product/ua-manager-request-handler-product.c
ua-daemon/src/ua-manager-request-handler.c

old mode 100644 (file)
new mode 100755 (executable)
index b4fa365..8ac4301
@@ -1471,6 +1471,40 @@ int _uam_service_add_payload(const char *service,
  */
 int _uam_get_added_payloads(GPtrArray **payload_list);
 
+/**
+ * @brief Requests to add a sensor info.
+ * @since_tizen 6.5
+ *
+ * @param[in] bitmask Sensor bitmask.
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
+int _uam_request_add_sensor(unsigned int bitmask);
+
+/**
+ * @brief Requests to remove a sensor info.
+ * @since_tizen 6.5
+ *
+ * @param[in] bitmask Sensor bitmask.
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
+int _uam_request_remove_sensor(unsigned int bitmask);
+
 #ifdef __cplusplus
 }
 #endif
old mode 100644 (file)
new mode 100755 (executable)
index c6f5e6a..0e3e2e0
@@ -32,8 +32,9 @@ extern "C" {
 #define UAM_SERVICE_DBUS "org.freedesktop.DBus"
 #define UAM_INTERFACE_DBUS "org.freedesktop.DBus"
 
-#define UAM_PRIVILEGE_PUBLIC "http://tizen.org/privilege/userawareness"
-#define UAM_PRIVILEGE_PLATFORM "http://tizen.org/privilege/userawareness.admin"
+#define UAM_PRIVILEGE_BLUETOOTH "http://tizen.org/privilege/bluetooth"
+#define UAM_PRIVILEGE_NETWORK "http://tizen.org/privilege/network.get"
+#define UAM_PRIVILEGE_LOCATION "http://tizen.org/privilege/location"
 
 #define FOREACH_REQUEST(REQUEST) \
        REQUEST(UAM_REQUEST_GET_AVAILABLE_SENSORS) \
@@ -89,6 +90,8 @@ extern "C" {
        REQUEST(UAM_REQUEST_ADD_PAYLOAD) \
        REQUEST(UAM_REQUEST_ADD_PAYLOAD_TO_SERVICE) \
        REQUEST(UAM_REQUEST_GET_PAYLOADS) \
+       REQUEST(UAM_REQUEST_ADD_SENSOR) \
+       REQUEST(UAM_REQUEST_REMOVE_SENSOR) \
        REQUEST(UAM_REQUEST_MAX)
 
 #define GENERATE_REQUEST_ENUM(ENUM) ENUM,
old mode 100644 (file)
new mode 100755 (executable)
index b9e4e7e..cb3336b
@@ -1535,3 +1535,39 @@ UAM_EXPORT_API int _uam_get_added_payloads(GPtrArray **payload_list)
        FUNC_EXIT;
        return ret;
 }
+
+UAM_EXPORT_API int _uam_request_add_sensor(unsigned int bitmask)
+{
+       FUNC_ENTRY;
+       int ret;
+
+       UAM_INIT_PARAMS();
+       UAM_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+
+       g_array_append_vals(in_param1, &bitmask, sizeof(unsigned int));
+       ret = _uam_sync_request(UAM_REQUEST_ADD_SENSOR,
+                       in_param1, in_param2, in_param3, in_param4, &out_param);
+
+       UAM_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+
+       FUNC_EXIT;
+       return ret;
+}
+
+UAM_EXPORT_API int _uam_request_remove_sensor(unsigned int bitmask)
+{
+       FUNC_ENTRY;
+       int ret;
+
+       UAM_INIT_PARAMS();
+       UAM_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+
+       g_array_append_vals(in_param1, &bitmask, sizeof(unsigned int));
+       ret = _uam_sync_request(UAM_REQUEST_REMOVE_SENSOR,
+                       in_param1, in_param2, in_param3, in_param4, &out_param);
+
+       UAM_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+
+       FUNC_EXIT;
+       return ret;
+}
old mode 100644 (file)
new mode 100755 (executable)
index 7ed1738..78d3105
@@ -82,8 +82,9 @@ do { \
                *ptr = NULL; \
 } while (0)
 
-#define UAM_PRIVLEVEL_PUBLIC   0
-#define UAM_PRIVLEVEL_PLATFORM 1
+#define UAM_PRIVTYPE_NA       0x00
+#define UAM_PRIVTYPE_DEVICE   0x01
+#define UAM_PRIVTYPE_LOCATION 0x02
 
 #define UAM_SYNC_FUNCTION      0
 #define UAM_ASYNC_FUNCTION     1
index b246323..6bf2216 100755 (executable)
@@ -45,13 +45,13 @@ static const gchar uam_manager_product_introspection_xml[] =
 
 typedef struct {
        uam_product_request_e request;
-       int priv_level;
+       int privilege_type;
        int function_type;
 } uam_product_request_table_s;
 
 
 static uam_product_request_table_s request_table[] = {
-       { UAM_PRODUCT_REQUEST_TEST, UAM_PRIVLEVEL_PLATFORM, UAM_PRODUCT_SYNC_FUNCTION },
+       { UAM_PRODUCT_REQUEST_TEST, UAM_PRIVTYPE_NA, UAM_PRODUCT_SYNC_FUNCTION },
 };
 
 static int __uam_manager_product_sync_request_handler(
index 2a740ea..64dbf46 100755 (executable)
@@ -64,64 +64,66 @@ static const gchar uam_manager_introspection_xml[] =
 
 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 */
@@ -1070,6 +1072,10 @@ static int __uam_manager_sync_request_handler(
                }
                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);
@@ -1301,19 +1307,133 @@ static int __uam_manager_get_function_type(int 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);
 
@@ -1326,27 +1446,36 @@ gboolean __uam_manager_check_privilege(int function,
                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);
 
@@ -1432,7 +1561,8 @@ static void __uam_manager_method(
 
                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;