Apply cynara implementation 95/56695/1 accepted/tizen/mobile/20160112.223425 accepted/tizen/tv/20160112.223444 accepted/tizen/wearable/20160112.223504 submit/tizen/20160112.064508
authorJihoon Jung <jh8801.jung@samsung.com>
Tue, 12 Jan 2016 06:24:08 +0000 (15:24 +0900)
committerJihoon Jung <jh8801.jung@samsung.com>
Tue, 12 Jan 2016 06:24:49 +0000 (15:24 +0900)
Signed-off-by: Ji-hoon Jung <jh8801.jung@samsung.com>
Change-Id: I331bac0131ffdc39b5ed5d5d14420dd4ce7ef503

33 files changed:
packaging/nfc-manager.spec
src/clientlib/include/net_nfc_client.h
src/clientlib/net_nfc_client.c
src/clientlib/net_nfc_client_handover.c
src/clientlib/net_nfc_client_hce.c
src/clientlib/net_nfc_client_llcp.c
src/clientlib/net_nfc_client_manager.c
src/clientlib/net_nfc_client_ndef.c
src/clientlib/net_nfc_client_p2p.c
src/clientlib/net_nfc_client_se.c
src/clientlib/net_nfc_client_snep.c
src/clientlib/net_nfc_client_system_handler.c
src/clientlib/net_nfc_client_tag.c
src/clientlib/net_nfc_client_test.c
src/clientlib/net_nfc_client_transceive.c
src/commonlib/include/net_nfc_typedef_internal.h
src/commonlib/net_nfc.xml
src/manager/CMakeLists.txt
src/manager/include/net_nfc_server_context_internal.h
src/manager/net_nfc_manager.c
src/manager/net_nfc_server_context.c
src/manager/net_nfc_server_handover.c
src/manager/net_nfc_server_hce.c
src/manager/net_nfc_server_llcp.c
src/manager/net_nfc_server_manager.c
src/manager/net_nfc_server_ndef.c
src/manager/net_nfc_server_p2p.c
src/manager/net_nfc_server_se.c
src/manager/net_nfc_server_snep.c
src/manager/net_nfc_server_system_handler.c
src/manager/net_nfc_server_tag.c
src/manager/net_nfc_server_test.c
src/manager/net_nfc_server_transceive.c

index def4dca..8fcf7c6 100755 (executable)
@@ -30,7 +30,9 @@ BuildRequires: pkgconfig(sqlite3)
 BuildRequires: pkgconfig(pkgmgr-info)
 BuildRequires: pkgconfig(libxml-2.0)
 BuildRequires: pkgconfig(libcurl)
-BuildRequires: pkgconfig(libprivilege-control)
+BuildRequires: pkgconfig(cynara-client)
+BuildRequires: pkgconfig(cynara-creds-gdbus)
+BuildRequires: pkgconfig(cynara-session)
 BuildRequires: python
 BuildRequires: python-xml
 
index 107cdd9..b32bb72 100755 (executable)
@@ -27,8 +27,6 @@ void net_nfc_client_gdbus_init(void);
 
 void net_nfc_client_gdbus_deinit(void);
 
-GVariant *net_nfc_client_gdbus_get_privilege();
-
 #ifdef __cplusplus
 }
 #endif
index 9bed54c..4b3d77d 100755 (executable)
@@ -46,11 +46,6 @@ void __attribute__ ((destructor)) lib_fini()
 {
 }
 
-GVariant *net_nfc_client_gdbus_get_privilege()
-{
-       return net_nfc_util_gdbus_buffer_to_variant(NULL, 0);
-}
-
 void net_nfc_client_gdbus_init(void)
 {
 #if 0          /* change gdbus init time */
index cffc0d1..7bcd49c 100755 (executable)
@@ -231,7 +231,6 @@ net_nfc_error_e net_nfc_client_p2p_connection_handover(
        net_nfc_gdbus_handover_call_request(handover_proxy,
                                        GPOINTER_TO_UINT(tag_handle),
                                        arg_type,
-                                       net_nfc_client_gdbus_get_privilege(),
                                        NULL,
                                        p2p_connection_handover,
                                        funcdata);
@@ -271,7 +270,6 @@ net_nfc_error_e net_nfc_client_p2p_connection_handover_sync(
        if (net_nfc_gdbus_handover_call_request_sync(handover_proxy,
                GPOINTER_TO_UINT(tag_handle),
                arg_type,
-               net_nfc_client_gdbus_get_privilege(),
                (gint32 *)&out_result,
                (gint32 *)&out_type,
                &out_data,
index 3a0b89d..0d21368 100755 (executable)
@@ -95,8 +95,7 @@ net_nfc_error_e net_nfc_client_hce_set_event_received_cb(
        }
 
        if (net_nfc_gdbus_hce_call_start_hce_handler_sync(hce_proxy,
-               net_nfc_client_gdbus_get_privilege(), &result,
-               NULL, &error) == true) {
+               &result, NULL, &error) == true) {
                hce_handler.hce_event_cb = callback;
                hce_handler.hce_data = user_data;
        } else {
@@ -121,8 +120,7 @@ net_nfc_error_e net_nfc_client_hce_unset_event_received_cb(void)
        }
 
        if (net_nfc_gdbus_hce_call_stop_hce_handler_sync(hce_proxy,
-               net_nfc_client_gdbus_get_privilege(), &result,
-               NULL, &error) == true) {
+               &result, NULL, &error) == true) {
                hce_handler.hce_event_cb = NULL;
                hce_handler.hce_data = NULL;
        } else {
@@ -169,7 +167,6 @@ net_nfc_error_e net_nfc_client_hce_response_apdu_sync(
                hce_proxy,
                GPOINTER_TO_UINT(handle),
                arg_data,
-               net_nfc_client_gdbus_get_privilege(),
                &result,
                NULL,
                &error) == true) {
index 93c2b93..12d8b04 100755 (executable)
@@ -707,7 +707,6 @@ net_nfc_error_e net_nfc_client_llcp_config(net_nfc_llcp_config_info_h config,
 
        net_nfc_gdbus_llcp_call_config(llcp_proxy,
                                variant,
-                               net_nfc_client_gdbus_get_privilege(),
                                NULL,
                                llcp_call_config,
                                func_data);
@@ -747,7 +746,6 @@ net_nfc_error_e net_nfc_client_llcp_config_sync
 
        if (net_nfc_gdbus_llcp_call_config_sync(llcp_proxy,
                variant,
-               net_nfc_client_gdbus_get_privilege(),
                &result,
                NULL,
                &error) == FALSE)
@@ -826,7 +824,6 @@ net_nfc_error_e net_nfc_client_llcp_listen(net_nfc_llcp_socket_t socket,
                                socket_data->type,
                                socket_data->sap,
                                service_name,
-                               net_nfc_client_gdbus_get_privilege(),
                                NULL,
                                llcp_call_listen,
                                func_data);
@@ -890,7 +887,6 @@ net_nfc_error_e net_nfc_client_llcp_listen_sync(net_nfc_llcp_socket_t socket,
                                        socket_data->type,
                                        socket_data->sap,
                                        service_name,
-                                       net_nfc_client_gdbus_get_privilege(),
                                        &result,
                                        &out_client_socket,
                                        NULL,
@@ -950,7 +946,6 @@ net_nfc_error_e net_nfc_client_llcp_accept(net_nfc_llcp_socket_t socket,
        net_nfc_gdbus_llcp_call_accept(llcp_proxy,
                GPOINTER_TO_UINT(llcp_handle),
                socket,
-               net_nfc_client_gdbus_get_privilege(),
                NULL,
                llcp_call_accept,
                func_data);
@@ -981,7 +976,6 @@ net_nfc_error_e net_nfc_client_llcp_accept_sync(net_nfc_llcp_socket_t socket)
        if (net_nfc_gdbus_llcp_call_accept_sync(llcp_proxy,
                GPOINTER_TO_UINT(llcp_handle),
                socket,
-               net_nfc_client_gdbus_get_privilege(),
                &result,
                NULL,
                &error) == false) {
@@ -1028,7 +1022,6 @@ net_nfc_error_e net_nfc_client_llcp_reject(net_nfc_llcp_socket_t socket,
        net_nfc_gdbus_llcp_call_reject(llcp_proxy,
                GPOINTER_TO_UINT(llcp_handle),
                socket,
-               net_nfc_client_gdbus_get_privilege(),
                NULL,
                llcp_call_reject,
                func_data);
@@ -1059,7 +1052,6 @@ net_nfc_error_e net_nfc_client_llcp_reject_sync(net_nfc_llcp_socket_t socket)
        if (net_nfc_gdbus_llcp_call_reject_sync(llcp_proxy,
                GPOINTER_TO_UINT(llcp_handle),
                socket,
-               net_nfc_client_gdbus_get_privilege(),
                &result,
                NULL,
                &error) == false) {
@@ -1123,7 +1115,6 @@ net_nfc_error_e net_nfc_client_llcp_connect(net_nfc_llcp_socket_t socket,
                                socket_data->rw,
                                socket_data->type,
                                service_name,
-                               net_nfc_client_gdbus_get_privilege(),
                                NULL,
                                llcp_call_connect,
                                func_data);
@@ -1175,7 +1166,6 @@ net_nfc_error_e net_nfc_client_llcp_connect_sync(net_nfc_llcp_socket_t socket,
                                        socket_data->rw,
                                        socket_data->type,
                                        service_name,
-                                       net_nfc_client_gdbus_get_privilege(),
                                        &result,
                                        &out_client_socket,
                                        NULL,
@@ -1252,7 +1242,6 @@ net_nfc_error_e net_nfc_client_llcp_connect_sap(net_nfc_llcp_socket_t socket,
                                socket_data->rw,
                                socket_data->type,
                                sap,
-                               net_nfc_client_gdbus_get_privilege(),
                                NULL,
                                llcp_call_connect_sap,
                                func_data);
@@ -1309,7 +1298,6 @@ net_nfc_error_e net_nfc_client_llcp_connect_sap_sync(
                                        socket_data->rw,
                                        socket_data->type,
                                        sap,
-                                       net_nfc_client_gdbus_get_privilege(),
                                        &result,
                                        &out_client_socket,
                                        NULL,
@@ -1390,7 +1378,6 @@ net_nfc_error_e net_nfc_client_llcp_send(net_nfc_llcp_socket_t socket,
                                GPOINTER_TO_UINT(llcp_handle),
                                socket_data->client_socket,
                                variant,
-                               net_nfc_client_gdbus_get_privilege(),
                                NULL,
                                llcp_call_send,
                                func_data);
@@ -1445,7 +1432,6 @@ net_nfc_error_e net_nfc_client_llcp_send_sync(net_nfc_llcp_socket_t socket,
                GPOINTER_TO_UINT(llcp_handle),
                socket_data->client_socket,
                variant,
-               net_nfc_client_gdbus_get_privilege(),
                &result,
                &out_client_socket,
                NULL,
@@ -1524,7 +1510,6 @@ net_nfc_error_e net_nfc_client_llcp_send_to(net_nfc_llcp_socket_t socket,
                socket_data->client_socket,
                sap,
                variant,
-               net_nfc_client_gdbus_get_privilege(),
                NULL,
                llcp_call_send_to,
                func_data);
@@ -1581,7 +1566,6 @@ net_nfc_error_e net_nfc_client_llcp_send_to_sync(net_nfc_llcp_socket_t socket,
                socket_data->client_socket,
                sap,
                variant,
-               net_nfc_client_gdbus_get_privilege(),
                &result,
                &out_client_socket,
                NULL,
@@ -1650,7 +1634,6 @@ net_nfc_error_e net_nfc_client_llcp_receive(net_nfc_llcp_socket_t socket,
                                GPOINTER_TO_UINT(llcp_handle),
                                socket_data->client_socket,
                                request_length,
-                               net_nfc_client_gdbus_get_privilege(),
                                NULL,
                                llcp_call_receive,
                                func_data);
@@ -1703,7 +1686,6 @@ net_nfc_error_e net_nfc_client_llcp_receive_sync(net_nfc_llcp_socket_t socket,
                GPOINTER_TO_UINT(llcp_handle),
                socket_data->client_socket,
                request_length,
-               net_nfc_client_gdbus_get_privilege(),
                &result,
                &variant,
                NULL,
@@ -1762,7 +1744,6 @@ net_nfc_error_e net_nfc_client_llcp_receive_from(net_nfc_llcp_socket_t socket,
                                GPOINTER_TO_UINT(llcp_handle),
                                socket_data->client_socket,
                                request_length,
-                               net_nfc_client_gdbus_get_privilege(),
                                NULL,
                                llcp_call_receive_from,
                                func_data);
@@ -1820,7 +1801,6 @@ net_nfc_error_e net_nfc_client_llcp_receive_from_sync(
                GPOINTER_TO_UINT(llcp_handle),
                socket_data->client_socket,
                request_length,
-               net_nfc_client_gdbus_get_privilege(),
                &result,
                &sap,
                &variant,
@@ -1884,7 +1864,6 @@ net_nfc_error_e net_nfc_client_llcp_close(net_nfc_llcp_socket_t socket,
        net_nfc_gdbus_llcp_call_close(llcp_proxy,
                                GPOINTER_TO_UINT(llcp_handle),
                                socket_data->client_socket,
-                               net_nfc_client_gdbus_get_privilege(),
                                NULL,
                                llcp_call_close,
                                func_data);
@@ -1930,7 +1909,6 @@ net_nfc_error_e net_nfc_client_llcp_close_sync(net_nfc_llcp_socket_t socket)
        if (net_nfc_gdbus_llcp_call_close_sync(llcp_proxy,
                GPOINTER_TO_UINT(llcp_handle),
                socket_data->client_socket,
-               net_nfc_client_gdbus_get_privilege(),
                &result,
                &out_client_socket,
                NULL,
@@ -1997,7 +1975,6 @@ net_nfc_error_e net_nfc_client_llcp_disconnect(net_nfc_llcp_socket_t socket,
        net_nfc_gdbus_llcp_call_disconnect(llcp_proxy,
                                GPOINTER_TO_UINT(llcp_handle),
                                socket_data->client_socket,
-                               net_nfc_client_gdbus_get_privilege(),
                                NULL,
                                llcp_call_disconnect,
                                func_data);
@@ -2044,7 +2021,6 @@ net_nfc_error_e net_nfc_client_llcp_disconnect_sync(
        if (net_nfc_gdbus_llcp_call_disconnect_sync(llcp_proxy,
                GPOINTER_TO_UINT(llcp_handle),
                socket_data->client_socket,
-               net_nfc_client_gdbus_get_privilege(),
                &result,
                &out_client_socket,
                NULL,
index 42c450c..2958ccf 100755 (executable)
@@ -263,7 +263,6 @@ net_nfc_error_e net_nfc_client_manager_set_active(int state,
 
        net_nfc_gdbus_manager_call_set_active(auto_start_proxy,
                active,
-               net_nfc_client_gdbus_get_privilege(),
                NULL,
                manager_call_set_active_callback,
                func_data);
@@ -300,7 +299,6 @@ net_nfc_error_e net_nfc_client_manager_set_active_sync(int state)
 
        if (net_nfc_gdbus_manager_call_set_active_sync(auto_start_proxy,
                (gboolean)state,
-               net_nfc_client_gdbus_get_privilege(),
                &out_result,
                NULL,
                &error) == FALSE)
@@ -338,7 +336,6 @@ net_nfc_error_e net_nfc_client_manager_get_server_state(
        func_data->user_data = user_data;
 
        net_nfc_gdbus_manager_call_get_server_state(manager_proxy,
-                                       net_nfc_client_gdbus_get_privilege(),
                                        NULL,
                                        manager_call_get_server_state_callback,
                                        func_data);
@@ -368,7 +365,6 @@ net_nfc_error_e net_nfc_client_manager_get_server_state_sync(
        }
 
        if (net_nfc_gdbus_manager_call_get_server_state_sync(manager_proxy,
-                                       net_nfc_client_gdbus_get_privilege(),
                                        &out_result,
                                        &out_state,
                                        NULL,
index 404f36d..0b7316e 100755 (executable)
@@ -260,7 +260,6 @@ net_nfc_error_e net_nfc_client_ndef_read(net_nfc_target_handle_h handle,
 
        net_nfc_gdbus_ndef_call_read(ndef_proxy,
                        GPOINTER_TO_UINT(handle),
-                       net_nfc_client_gdbus_get_privilege(),
                        NULL,
                        ndef_call_read,
                        func_data);
@@ -300,7 +299,6 @@ net_nfc_error_e net_nfc_client_ndef_read_sync(net_nfc_target_handle_h handle,
 
        if (net_nfc_gdbus_ndef_call_read_sync(ndef_proxy,
                                        GPOINTER_TO_UINT(handle),
-                                       net_nfc_client_gdbus_get_privilege(),
                                        (gint *)&out_result,
                                        &out_data,
                                        NULL,
@@ -359,7 +357,6 @@ net_nfc_error_e net_nfc_client_ndef_write(net_nfc_target_handle_h handle,
        net_nfc_gdbus_ndef_call_write(ndef_proxy,
                                GPOINTER_TO_UINT(handle),
                                arg_data,
-                               net_nfc_client_gdbus_get_privilege(),
                                NULL,
                                ndef_call_write,
                                func_data);
@@ -400,7 +397,6 @@ net_nfc_error_e net_nfc_client_ndef_write_sync(net_nfc_target_handle_h handle,
        if (net_nfc_gdbus_ndef_call_write_sync(ndef_proxy ,
                                        GPOINTER_TO_UINT(handle),
                                        arg_data,
-                                       net_nfc_client_gdbus_get_privilege(),
                                        (gint *)&out_result,
                                        NULL,
                                        &error) == FALSE)
@@ -456,7 +452,6 @@ net_nfc_error_e net_nfc_client_ndef_make_read_only(
 
        net_nfc_gdbus_ndef_call_make_read_only(ndef_proxy,
                                GPOINTER_TO_UINT(handle),
-                               net_nfc_client_gdbus_get_privilege(),
                                NULL,
                                ndef_call_make_read_only,
                                func_data);
@@ -496,7 +491,6 @@ net_nfc_error_e net_nfc_client_ndef_make_read_only_sync(
 
        if (net_nfc_gdbus_ndef_call_make_read_only_sync(ndef_proxy,
                                        GPOINTER_TO_UINT(handle),
-                                       net_nfc_client_gdbus_get_privilege(),
                                        (gint *)&out_result,
                                        NULL,
                                        &error) == FALSE)
@@ -553,7 +547,6 @@ net_nfc_error_e net_nfc_client_ndef_format(net_nfc_target_handle_h handle,
        net_nfc_gdbus_ndef_call_format(ndef_proxy ,
                                GPOINTER_TO_UINT(handle),
                                arg_data,
-                               net_nfc_client_gdbus_get_privilege(),
                                NULL,
                                ndef_call_format,
                                func_data);
@@ -595,7 +588,6 @@ net_nfc_error_e net_nfc_client_ndef_format_sync(
        if (net_nfc_gdbus_ndef_call_format_sync(ndef_proxy ,
                                        GPOINTER_TO_UINT(handle),
                                        arg_data,
-                                       net_nfc_client_gdbus_get_privilege(),
                                        (gint *)&out_result,
                                        NULL,
                                        &error) == FALSE)
index e7536e2..6997d15 100755 (executable)
@@ -183,7 +183,6 @@ net_nfc_error_e net_nfc_client_p2p_send(net_nfc_target_handle_h handle,
                0 /* FIXME */,
                arg_data,
                GPOINTER_TO_UINT(handle),
-               net_nfc_client_gdbus_get_privilege(),
                NULL,
                p2p_call_send,
                func_data);
@@ -219,7 +218,6 @@ net_nfc_error_e net_nfc_client_p2p_send_sync(net_nfc_target_handle_h handle,
                0 /* FIXME */,
                arg_data,
                GPOINTER_TO_UINT(handle),
-               net_nfc_client_gdbus_get_privilege(),
                (gint *)&out_result,
                NULL,
                &error) == FALSE)
index 3d5de82..95561cc 100755 (executable)
@@ -185,7 +185,6 @@ static void se_transaction_event(GObject *source_object,
        if (net_nfc_gdbus_secure_element_call_check_transaction_permission_sync(
                NET_NFC_GDBUS_SECURE_ELEMENT(source_object),
                arg_aid,
-               net_nfc_client_gdbus_get_privilege(),
                &result,
                NULL,
                &error) == false) {
@@ -474,7 +473,6 @@ net_nfc_error_e net_nfc_client_se_set_secure_element_type(
        net_nfc_gdbus_secure_element_call_set(
                                se_proxy,
                                (gint)se_type,
-                               net_nfc_client_gdbus_get_privilege(),
                                NULL,
                                set_secure_element,
                                func_data);
@@ -507,7 +505,6 @@ net_nfc_error_e net_nfc_client_se_set_secure_element_type_sync(
        if (net_nfc_gdbus_secure_element_call_set_sync(
                        se_proxy,
                        (gint)se_type,
-                       net_nfc_client_gdbus_get_privilege(),
                        &result,
                        NULL,
                        &error) == FALSE)
@@ -552,7 +549,6 @@ net_nfc_error_e net_nfc_client_se_get_secure_element_type_sync(
 #else
        if (net_nfc_gdbus_secure_element_call_get_sync(
                        se_proxy,
-                       net_nfc_client_gdbus_get_privilege(),
                        &result,
                        &type,
                        NULL,
@@ -595,7 +591,6 @@ net_nfc_error_e net_nfc_set_card_emulation_mode_sync(
        if (net_nfc_gdbus_secure_element_call_set_card_emulation_sync(
                        se_proxy,
                        (gint)mode,
-                       net_nfc_client_gdbus_get_privilege(),
                        &result,
                        NULL,
                        &error) == FALSE)
@@ -633,7 +628,6 @@ net_nfc_error_e net_nfc_get_card_emulation_mode_sync(
 
        if (net_nfc_gdbus_secure_element_call_get_card_emulation_sync(
                        se_proxy,
-                       net_nfc_client_gdbus_get_privilege(),
                        &result,
                        &type,
                        NULL,
@@ -690,7 +684,6 @@ net_nfc_error_e net_nfc_client_se_open_internal_secure_element(
        net_nfc_gdbus_secure_element_call_open_secure_element(
                                        auto_start_proxy,
                                        (gint)se_type,
-                                       net_nfc_client_gdbus_get_privilege(),
                                        NULL,
                                        open_secure_element,
                                        func_data);
@@ -737,7 +730,6 @@ net_nfc_error_e net_nfc_client_se_open_internal_secure_element_sync(
        if (net_nfc_gdbus_secure_element_call_open_secure_element_sync(
                                        auto_start_proxy,
                                        se_type,
-                                       net_nfc_client_gdbus_get_privilege(),
                                        &result,
                                        &out_handle,
                                        NULL,
@@ -795,7 +787,6 @@ net_nfc_error_e net_nfc_client_se_close_internal_secure_element(
        net_nfc_gdbus_secure_element_call_close_secure_element(
                auto_start_proxy,
                GPOINTER_TO_UINT(handle),
-               net_nfc_client_gdbus_get_privilege(),
                NULL,
                close_secure_element,
                func_data);
@@ -836,7 +827,6 @@ net_nfc_error_e net_nfc_client_se_close_internal_secure_element_sync(
        if (net_nfc_gdbus_secure_element_call_close_secure_element_sync(
                auto_start_proxy,
                GPOINTER_TO_UINT(handle),
-               net_nfc_client_gdbus_get_privilege(),
                &result,
                NULL,
                &error) == FALSE)
@@ -892,7 +882,6 @@ net_nfc_error_e net_nfc_client_se_get_atr(
        net_nfc_gdbus_secure_element_call_get_atr(
                auto_start_proxy,
                GPOINTER_TO_UINT(handle),
-               net_nfc_client_gdbus_get_privilege(),
                NULL,
                get_atr_secure_element,
                func_data);
@@ -941,7 +930,6 @@ net_nfc_error_e net_nfc_client_se_get_atr_sync(
        if (net_nfc_gdbus_secure_element_call_get_atr_sync(
                auto_start_proxy,
                GPOINTER_TO_UINT(handle),
-               net_nfc_client_gdbus_get_privilege(),
                &result,
                &out_atr,
                NULL,
@@ -1008,7 +996,6 @@ net_nfc_error_e net_nfc_client_se_send_apdu(
                auto_start_proxy,
                GPOINTER_TO_UINT(handle),
                arg_data,
-               net_nfc_client_gdbus_get_privilege(),
                NULL,
                send_apdu_secure_element,
                func_data);
@@ -1064,7 +1051,6 @@ net_nfc_error_e net_nfc_client_se_send_apdu_sync(
                auto_start_proxy,
                GPOINTER_TO_UINT(handle),
                arg_data,
-               net_nfc_client_gdbus_get_privilege(),
                &result,
                &out_data,
                NULL,
@@ -1208,7 +1194,6 @@ net_nfc_error_e net_nfc_client_se_set_transaction_fg_dispatch(int mode)
        if (net_nfc_gdbus_secure_element_call_set_transaction_fg_dispatch_sync(
                auto_start_proxy,
                mode,
-               net_nfc_client_gdbus_get_privilege(),
                &result,
                NULL,
                &error) != true) {
@@ -1247,7 +1232,6 @@ net_nfc_error_e net_nfc_client_se_set_default_route_sync(
                switch_on,
                switch_off,
                battery_off,
-               net_nfc_client_gdbus_get_privilege(),
                &result,
                NULL,
                &error) == FALSE)
@@ -1288,7 +1272,6 @@ net_nfc_error_e net_nfc_client_se_is_activated_aid_handler_sync(
                        se_proxy,
                        se_type,
                        aid,
-                       net_nfc_client_gdbus_get_privilege(),
                        &result,
                        &ret,
                        NULL,
@@ -1330,7 +1313,6 @@ net_nfc_error_e net_nfc_client_se_is_activated_category_handler_sync(
                        se_proxy,
                        se_type,
                        category,
-                       net_nfc_client_gdbus_get_privilege(),
                        &result,
                        &ret,
                        NULL,
@@ -1373,7 +1355,6 @@ net_nfc_error_e net_nfc_client_se_get_registered_aids_count_sync(
                        se_proxy,
                        se_type,
                        category,
-                       net_nfc_client_gdbus_get_privilege(),
                        &result,
                        &aids,
                        NULL,
@@ -1426,7 +1407,6 @@ net_nfc_error_e net_nfc_client_se_foreach_registered_aids_sync(
                        se_proxy,
                        se_type,
                        category,
-                       net_nfc_client_gdbus_get_privilege(),
                        &result,
                        &aids,
                        NULL,
@@ -1475,7 +1455,6 @@ net_nfc_error_e net_nfc_client_se_register_aids_sync(net_nfc_se_type_e se_type,
                        se_type,
                        category,
                        aid,
-                       net_nfc_client_gdbus_get_privilege(),
                        &result,
                        NULL,
                        &error) == FALSE)
@@ -1510,7 +1489,6 @@ net_nfc_error_e net_nfc_client_se_unregister_aid_sync(net_nfc_se_type_e se_type,
                        se_type,
                        category,
                        aid,
-                       net_nfc_client_gdbus_get_privilege(),
                        &result,
                        NULL,
                        &error) == FALSE)
@@ -1543,7 +1521,6 @@ net_nfc_error_e net_nfc_client_se_unregister_aids_sync(net_nfc_se_type_e se_type
                        se_proxy,
                        se_type,
                        category,
-                       net_nfc_client_gdbus_get_privilege(),
                        &result,
                        NULL,
                        &error) == FALSE)
@@ -1583,7 +1560,6 @@ net_nfc_error_e net_nfc_client_se_foreach_registered_handlers_sync(
        if (net_nfc_gdbus_secure_element_call_get_registered_handlers_sync(
                        se_proxy,
                        category,
-                       net_nfc_client_gdbus_get_privilege(),
                        &result,
                        &handlers,
                        NULL,
@@ -1646,7 +1622,6 @@ net_nfc_error_e net_nfc_client_se_add_route_aid_sync(
                category,
                unlock_required,
                power,
-               net_nfc_client_gdbus_get_privilege(),
                &result,
                NULL,
                &error) == FALSE)
@@ -1693,7 +1668,6 @@ net_nfc_error_e net_nfc_client_se_remove_route_aid_sync(
                auto_start_proxy,
                package,
                aid,
-               net_nfc_client_gdbus_get_privilege(),
                &result,
                NULL,
                &error) == FALSE)
@@ -1739,7 +1713,6 @@ net_nfc_error_e net_nfc_client_se_remove_package_aids_sync(
        if (net_nfc_gdbus_secure_element_call_remove_package_aids_sync(
                auto_start_proxy,
                package,
-               net_nfc_client_gdbus_get_privilege(),
                &result,
                NULL,
                &error) == FALSE)
index 50e8af2..3920287 100755 (executable)
@@ -122,7 +122,6 @@ net_nfc_error_e net_nfc_client_snep_start_server(
                sap,
                san,
                GPOINTER_TO_UINT(parameter),
-               net_nfc_client_gdbus_get_privilege(),
                (gint *)&result,
                NULL,
                &error) == FALSE)
@@ -172,7 +171,6 @@ net_nfc_error_e net_nfc_client_snep_start_client(
                sap,
                san,
                GPOINTER_TO_UINT(parameter),
-               net_nfc_client_gdbus_get_privilege(),
                (gint *)&result,
                NULL,
                &error) == FALSE)
@@ -228,7 +226,6 @@ net_nfc_error_e net_nfc_client_snep_send_client_request(
                GPOINTER_TO_UINT(target),
                snep_type,
                ndef_msg,
-               net_nfc_client_gdbus_get_privilege(),
                NULL,
                snep_send_client_request,
                parameter);
@@ -271,7 +268,6 @@ net_nfc_error_e net_nfc_client_snep_send_client_request_sync(
                GPOINTER_TO_UINT(target),
                snep_type,
                arg_msg,
-               net_nfc_client_gdbus_get_privilege(),
                &result,
                resp_type,
                &resp_msg,
@@ -333,7 +329,6 @@ net_nfc_error_e net_nfc_client_snep_stop_service_sync(
                snep_proxy,
                GPOINTER_TO_UINT(target),
                GPOINTER_TO_UINT(service),
-               net_nfc_client_gdbus_get_privilege(),
                (gint *)&result,
                NULL,
                &error) == FALSE)
@@ -430,7 +425,6 @@ net_nfc_error_e net_nfc_client_snep_register_server(const char *san,
                sap,
                san,
                GPOINTER_TO_UINT(parameter),
-               net_nfc_client_gdbus_get_privilege(),
                (gint *)&result,
                NULL,
                &error) == FALSE)
@@ -469,7 +463,6 @@ net_nfc_error_e net_nfc_client_snep_unregister_server(const char *san,
        if (net_nfc_gdbus_snep_call_server_unregister_sync(snep_proxy,
                sap,
                san,
-               net_nfc_client_gdbus_get_privilege(),
                (gint *)&result,
                NULL,
                &error) == FALSE)
index 19bce60..2616b8a 100755 (executable)
@@ -100,7 +100,6 @@ net_nfc_error_e net_nfc_client_sys_handler_set_state(int state,
        net_nfc_gdbus_popup_call_set(popup_proxy,
                state,
                CHECK_FOREGROUND,
-               net_nfc_client_gdbus_get_privilege(),
                NULL,
                popup_set_active_callback,
                func_data);
@@ -131,7 +130,6 @@ net_nfc_error_e net_nfc_client_sys_handler_set_state_sync(int state)
        if (net_nfc_gdbus_popup_call_set_sync(popup_proxy,
                state,
                CHECK_FOREGROUND,
-               net_nfc_client_gdbus_get_privilege(),
                &result,
                NULL,
                &error) == FALSE)
@@ -177,7 +175,6 @@ net_nfc_error_e net_nfc_client_sys_handler_set_state_force(int state,
        net_nfc_gdbus_popup_call_set(popup_proxy,
                state,
                NO_CHECK_FOREGROUND,
-               net_nfc_client_gdbus_get_privilege(),
                NULL,
                popup_set_active_callback,
                func_data);
@@ -208,7 +205,6 @@ net_nfc_error_e net_nfc_client_sys_handler_set_state_force_sync(int state)
        if (net_nfc_gdbus_popup_call_set_sync(popup_proxy,
                state,
                NO_CHECK_FOREGROUND,
-               net_nfc_client_gdbus_get_privilege(),
                &result,
                NULL,
                &error) == FALSE)
@@ -268,7 +264,6 @@ net_nfc_error_e net_nfc_client_sys_handler_get_launch_popup_state(
        }
 
        if (net_nfc_gdbus_popup_call_get_sync(popup_proxy,
-               net_nfc_client_gdbus_get_privilege(),
                &result,
                &out_state,
                NULL,
index 75cde4b..d191a5b 100755 (executable)
@@ -468,39 +468,6 @@ net_nfc_target_info_s *net_nfc_client_tag_get_client_target_info(void)
        return client_target_info;
 }
 
-/* public APIs */
-#if 0
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_tag_is_tag_connected(
-                       net_nfc_client_tag_is_tag_connected_completed callback,
-                       void *user_data)
-{
-       NetNfcCallback *func_data;
-
-       if (tag_proxy == NULL)
-               return NET_NFC_NOT_INITIALIZED;
-
-       /* prevent executing daemon when nfc is off */
-       if (net_nfc_client_manager_is_activated() == false) {
-               return NET_NFC_INVALID_STATE;
-       }
-
-       func_data = g_try_new0(NetNfcCallback, 1);
-       if (func_data == NULL)
-               return NET_NFC_ALLOC_FAIL;
-
-       func_data->callback = (gpointer)callback;
-       func_data->user_data = user_data;
-
-       net_nfc_gdbus_tag_call_is_tag_connected(tag_proxy,
-                                       net_nfc_client_gdbus_get_privilege(),
-                                       NULL,
-                                       tag_is_tag_connected,
-                                       func_data);
-
-       return NET_NFC_OK;
-}
-#endif
 NET_NFC_EXPORT_API
 net_nfc_error_e net_nfc_client_tag_is_tag_connected_sync(
                                        net_nfc_target_type_e *dev_type)
@@ -523,7 +490,6 @@ net_nfc_error_e net_nfc_client_tag_is_tag_connected_sync(
        if (info == NULL) {
                /* try to request target information from server */
                if (net_nfc_gdbus_tag_call_is_tag_connected_sync(tag_proxy,
-                                       net_nfc_client_gdbus_get_privilege(),
                                        &result,
                                        &out_is_connected,
                                        (gint *)&out_dev_type,
@@ -558,40 +524,6 @@ net_nfc_error_e net_nfc_client_tag_is_tag_connected_sync(
 
        return result;
 }
-#if 0
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_tag_get_current_tag_info(
-               net_nfc_client_tag_get_current_tag_info_completed callback,
-               void *user_data)
-{
-       NetNfcCallback *func_data;
-
-       if (tag_proxy == NULL)
-               return NET_NFC_NOT_INITIALIZED;
-
-       /* prevent executing daemon when nfc is off */
-       if (net_nfc_client_manager_is_activated() == false) {
-               return NET_NFC_INVALID_STATE;
-       }
-
-       func_data = g_try_new0(NetNfcCallback, 1);
-       if (func_data == NULL) {
-               return NET_NFC_ALLOC_FAIL;
-       }
-
-       func_data->callback = (gpointer)callback;
-       func_data->user_data = user_data;
-
-       net_nfc_gdbus_tag_call_get_current_tag_info(tag_proxy,
-                                       net_nfc_client_gdbus_get_privilege(),
-                                       NULL,
-                                       tag_get_current_tag_info,
-                                       func_data);
-
-       return NET_NFC_OK;
-}
-#endif
-
 
 NET_NFC_EXPORT_API
 net_nfc_error_e net_nfc_client_barcode_get_barcode_sync(
@@ -611,7 +543,6 @@ net_nfc_error_e net_nfc_client_barcode_get_barcode_sync(
        }
 
        if (net_nfc_gdbus_tag_call_get_barcode_sync(tag_proxy,
-                               net_nfc_client_gdbus_get_privilege(),
                                &result,
                                &out_barcode,
                                NULL,
@@ -674,7 +605,6 @@ net_nfc_error_e net_nfc_client_tag_get_current_tag_info_sync(
        if (net_nfc_client_tag_get_client_target_info() == NULL) {
                /* try to request target information from server */
                if (net_nfc_gdbus_tag_call_get_current_tag_info_sync(tag_proxy,
-                                       net_nfc_client_gdbus_get_privilege(),
                                        &result,
                                        &out_is_connected,
                                        &out_handle,
@@ -732,39 +662,7 @@ net_nfc_error_e net_nfc_client_tag_get_current_tag_info_sync(
 
        return result;
 }
-#if 0
-NET_NFC_EXPORT_API
-net_nfc_error_e net_nfc_client_tag_get_current_target_handle(
-       net_nfc_client_tag_get_current_target_handle_completed callback,
-       void *user_data)
-{
-       NetNfcCallback *func_data;
-
-       if (tag_proxy == NULL)
-               return NET_NFC_NOT_INITIALIZED;
-
-       /* prevent executing daemon when nfc is off */
-       if (net_nfc_client_manager_is_activated() == false) {
-               return NET_NFC_INVALID_STATE;
-       }
-
-       func_data = g_try_new0(NetNfcCallback, 1);
-       if (func_data == NULL) {
-               return NET_NFC_ALLOC_FAIL;
-       }
-
-       func_data->callback = (gpointer)callback;
-       func_data->user_data = user_data;
-
-       net_nfc_gdbus_tag_call_get_current_target_handle(tag_proxy,
-                                       net_nfc_client_gdbus_get_privilege(),
-                                       NULL,
-                                       tag_get_current_target_handle,
-                                       func_data);
 
-       return NET_NFC_OK;
-}
-#endif
 NET_NFC_EXPORT_API
 net_nfc_error_e net_nfc_client_tag_get_current_target_handle_sync(
                                        net_nfc_target_handle_h *handle)
@@ -788,7 +686,6 @@ net_nfc_error_e net_nfc_client_tag_get_current_target_handle_sync(
        if (info == NULL) {
                if (net_nfc_gdbus_tag_call_get_current_target_handle_sync(
                        tag_proxy,
-                       net_nfc_client_gdbus_get_privilege(),
                        &result,
                        &out_is_connected,
                        &out_handle,
index 6558995..0409b7d 100755 (executable)
@@ -252,7 +252,6 @@ net_nfc_error_e net_nfc_client_test_sim_test(
        func_data->user_data = user_data;
 
        net_nfc_gdbus_test_call_sim_test(test_proxy,
-                                       net_nfc_client_gdbus_get_privilege(),
                                        NULL,
                                        test_call_sim_test_callback,
                                        func_data);
@@ -281,7 +280,6 @@ net_nfc_error_e net_nfc_client_test_sim_test_sync(void)
        }
 
        if (net_nfc_gdbus_test_call_sim_test_sync(test_proxy,
-                                       net_nfc_client_gdbus_get_privilege(),
                                        (gint *)&out_result,
                                        NULL,
                                        &error) == FALSE)
@@ -328,7 +326,6 @@ net_nfc_error_e net_nfc_client_test_prbs_test(uint32_t tech,
        net_nfc_gdbus_test_call_prbs_test(test_proxy,
                                        tech,
                                        rate,
-                                       net_nfc_client_gdbus_get_privilege(),
                                        NULL,
                                        test_call_prbs_test_callback,
                                        func_data);
@@ -360,7 +357,6 @@ net_nfc_error_e net_nfc_client_test_prbs_test_sync(uint32_t tech,
        if (net_nfc_gdbus_test_call_prbs_test_sync(test_proxy,
                                        tech,
                                        rate,
-                                       net_nfc_client_gdbus_get_privilege(),
                                        (gint *)&out_result,
                                        NULL,
                                        &error) == FALSE)
@@ -404,7 +400,6 @@ net_nfc_error_e net_nfc_client_test_get_firmware_version(
        func_data->user_data = user_data;
 
        net_nfc_gdbus_test_call_get_firmware_version(test_proxy,
-                               net_nfc_client_gdbus_get_privilege(),
                                NULL,
                                test_call_get_firmware_version_callback,
                                func_data);
@@ -439,7 +434,6 @@ net_nfc_error_e net_nfc_client_test_get_firmware_version_sync(char **version)
        }
 
        if (net_nfc_gdbus_test_call_get_firmware_version_sync(test_proxy,
-                                       net_nfc_client_gdbus_get_privilege(),
                                        (gint *)&out_result,
                                        &out_version,
                                        NULL,
@@ -497,7 +491,6 @@ net_nfc_error_e net_nfc_client_test_set_ee_data(int mode,
                                        mode,
                                        reg_id,
                                        variant,
-                                       net_nfc_client_gdbus_get_privilege(),
                                        NULL,
                                        test_call_set_ee_data_callback,
                                        func_data);
@@ -534,7 +527,6 @@ net_nfc_error_e net_nfc_client_test_set_ee_data_sync(int mode,
                                        mode,
                                        reg_id,
                                        variant,
-                                       net_nfc_client_gdbus_get_privilege(),
                                        (gint *)&out_result,
                                        NULL,
                                        &error) == FALSE)
@@ -580,7 +572,6 @@ net_nfc_error_e net_nfc_client_test_ese_test(
        func_data->user_data = user_data;
 
        net_nfc_gdbus_test_call_ese_test(test_proxy,
-                                       net_nfc_client_gdbus_get_privilege(),
                                        NULL,
                                        test_call_ese_test_callback,
                                        func_data);
@@ -611,7 +602,6 @@ net_nfc_error_e net_nfc_client_test_ese_test_sync(void)
        }
 
        if (net_nfc_gdbus_test_call_ese_test_sync(test_proxy,
-                                       net_nfc_client_gdbus_get_privilege(),
                                        (gint *)&out_result,
                                        NULL,
                                        &error) == FALSE)
@@ -650,7 +640,6 @@ net_nfc_error_e net_nfc_client_test_set_se_tech_type_sync(
        if (net_nfc_gdbus_test_call_set_se_tech_type_sync(test_proxy,
                                        (guint32)type,
                                        (guint32)tech,
-                                       net_nfc_client_gdbus_get_privilege(),
                                        (gint *)&out_result,
                                        NULL,
                                        &error) == FALSE)
index 2fc820c..0f7f5f3 100755 (executable)
@@ -242,7 +242,6 @@ net_nfc_error_e net_nfc_client_transceive(net_nfc_target_handle_h handle,
                                        GPOINTER_TO_UINT(handle),
                                        target_info->devType,
                                        arg_data,
-                                       net_nfc_client_gdbus_get_privilege(),
                                        NULL,
                                        transceive_call,
                                        funcdata);
@@ -303,7 +302,6 @@ net_nfc_error_e net_nfc_client_transceive_data(net_nfc_target_handle_h handle,
                                        GPOINTER_TO_UINT(handle),
                                        target_info->devType,
                                        arg_data,
-                                       net_nfc_client_gdbus_get_privilege(),
                                        NULL,
                                        transceive_data_call,
                                        funcdata);
@@ -352,7 +350,6 @@ net_nfc_error_e net_nfc_client_transceive_sync(net_nfc_target_handle_h handle,
                                        GPOINTER_TO_UINT(handle),
                                        target_info->devType,
                                        arg_data,
-                                       net_nfc_client_gdbus_get_privilege(),
                                        (gint *)&out_result,
                                        NULL,
                                        &error) == FALSE)
@@ -412,7 +409,6 @@ net_nfc_error_e net_nfc_client_transceive_data_sync(
                                        GPOINTER_TO_UINT(handle),
                                        target_info->devType,
                                        arg_data,
-                                       net_nfc_client_gdbus_get_privilege(),
                                        (gint *)&out_result,
                                        &out_data,
                                        NULL,
index 6cf81d9..ecbd93f 100755 (executable)
@@ -199,6 +199,15 @@ typedef enum _net_nfc_launch_popup_state_e
        NET_NFC_NO_LAUNCH_APP_SELECT,
 } net_nfc_launch_popup_state_e;
 
+typedef enum _net_nfc_privilege_e
+{
+       NET_NFC_PRIVILEGE_NFC = 0x00,
+       NET_NFC_PRIVILEGE_NFC_ADMIN,
+       NET_NFC_PRIVILEGE_NFC_TAG,
+       NET_NFC_PRIVILEGE_NFC_P2P,
+       NET_NFC_PRIVILEGE_NFC_CARD_EMUL
+} net_nfc_privilege_e;
+
 /* server state */
 #define NET_NFC_SERVER_IDLE            0
 #define NET_NFC_SERVER_DISCOVERY       (1 << 1)
index e40d822..c6ad09f 100755 (executable)
@@ -10,7 +10,6 @@
     -->
     <method name="SetActive">
       <arg type="b" name="is_active" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
 
@@ -18,7 +17,6 @@
       GetServerState
     -->
     <method name="GetServerState">
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
       <arg type="u" name="state" direction="out" />
     </method>
@@ -36,7 +34,6 @@
       IsConnected
     -->
     <method name="IsTagConnected">
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
       <arg type="b" name="is_connected" direction="out" />
       <arg type="i" name="dev_type" direction="out" />
@@ -46,7 +43,6 @@
       GetInfo
     -->
     <method name="GetCurrentTagInfo">
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
       <arg type="b" name="is_connected" direction="out" />
       <arg type="u" name="handle" direction="out" />
@@ -64,7 +60,6 @@
       GetBarcode
     -->
     <method name="GetBarcode">
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
       <arg type="a(y)" name="barcode" direction="out" />
     </method>
@@ -73,7 +68,6 @@
       GetTagetHandle
     -->
     <method name="GetCurrentTargetHandle">
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
       <arg type="b" name="is_connected" direction="out" />
       <arg type="u" name="handle" direction="out" />
     -->
     <method name="Read">
       <arg type="u" name="handle" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
       <arg type="a(y)" name="data" direction="out" />
     </method>
     <method name="Write">
       <arg type="u" name="handle" direction="in" />
       <arg type="a(y)" name="data" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
 
     -->
     <method name="MakeReadOnly">
       <arg type="u" name="handle" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
 
     <method name="Format">
       <arg type="u" name="handle" direction="in" />
       <arg type="a(y)" name="key" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
   </interface>
     -->
     <method name="Config">
       <arg type="(qqyy)" name="config" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
 
       <arg type="i" name="type" direction="in" />
       <arg type="y" name="sap" direction="in" />
       <arg type="s" name="service_name" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
       <arg type="u" name="client_socket" direction="out" />
     </method>
     <method name="Accept">
       <arg type="u" name="handle" direction="in" />
       <arg type="u" name="client_socket" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
 
     <method name="Reject">
       <arg type="u" name="handle" direction="in" />
       <arg type="u" name="client_socket" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
 
       <arg type="y" name="rw" direction="in" />
       <arg type="i" name="type" direction="in" />
       <arg type="s" name="service_name" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
       <arg type="u" name="client_socket" direction="out" />
     </method>
       <arg type="y" name="rw" direction="in" />
       <arg type="i" name="type" direction="in" />
       <arg type="y" name="sap" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
       <arg type="u" name="client_socket" direction="out" />
     </method>
       <arg type="u" name="handle" direction="in" />
       <arg type="u" name="client_socket" direction="in" />
       <arg type="a(y)" name="data" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
       <arg type="u" name="client_socket" direction="out" />
     </method>
       <arg type="u" name="client_socket" direction="in" />
       <arg type="y" name="sap" direction="in" />
       <arg type="a(y)" name="data" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
       <arg type="u" name="client_socket" direction="out" />
     </method>
       <arg type="u" name="handle" direction="in" />
       <arg type="u" name="client_socket" direction="in" />
       <arg type="u" name="request_length" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
       <arg type="a(y)" name="data" direction="out" />
     </method>
       <arg type="u" name="handle" direction="in" />
       <arg type="u" name="client_socket" direction="in" />
       <arg type="u" name="request_length" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
       <arg type="y" name="sap" direction="out" />
       <arg type="a(y)" name="data" direction="out" />
     <method name="Close">
       <arg type="u" name="handle" direction="in" />
       <arg type="u" name="client_socket" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
       <arg type="u" name="client_socket" direction="out" />
     </method>
     <method name="Disconnect">
       <arg type="u" name="handle" direction="in" />
       <arg type="u" name="client_socket" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
       <arg type="u" name="client_socket" direction="out" />
     </method>
       <arg type="i" name="type" direction="in" />
       <arg type="a(y)" name="data" direction="in" />
       <arg type="u" name="handle" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
 
     <method name="Set">
       <arg type="i" name="state" direction="in" />
       <arg type="i" name="focus_state" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
 
       Get
     -->
     <method name="Get">
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
       <arg type="i" name="state" direction="out" />
     </method>
     -->
     <method name="Set">
       <arg type="i" name="type" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
 
       Get
     -->
     <method name="Get">
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
       <arg type="i" name="type" direction="out" />
     </method>
     -->
     <method name="SetCardEmulation">
       <arg type="i" name="mode" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
 
       GetCardEmulation
     -->
     <method name="GetCardEmulation">
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
       <arg type="i" name="type" direction="out" />
     </method>
     -->
     <method name="OpenSecureElement">
       <arg type="i" name="type" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
       <arg type="u" name="handle" direction="out" />
     </method>
     -->
     <method name="CloseSecureElement">
       <arg type="u" name="handle" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
 
     -->
     <method name="GetAtr">
       <arg type="u" name="handle" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
       <arg type="a(y)" name="atr" direction="out" />
     </method>
     <method name="SendAPDU">
       <arg type="u" name="handle" direction="in" />
       <arg type="a(y)" name="data" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
       <arg type="a(y)" name="response" direction="out" />
     </method>
     -->
     <method name="SetTransactionFgDispatch">
       <arg type="i" name="mode" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
 
        <arg type="u" name="switch_on" direction="in" />
        <arg type="u" name="switch_off" direction="in" />
        <arg type="u" name="battery_off" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
 
     -->
     <method name="CheckTransactionPermission">
       <arg type="a(y)" name="aid" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
 
     <method name="IsActivatedAidHandler">
       <arg type="u" name="type" direction="in" />
       <arg type="s" name="aid" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
       <arg type="b" name="activated" direction="out" />
     </method>
     <method name="IsActivatedCategoryHandler">
       <arg type="u" name="type" direction="in" />
       <arg type="u" name="category" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
       <arg type="b" name="activated" direction="out" />
     </method>
     <method name="GetRegisteredAids">
       <arg type="u" name="type" direction="in" />
       <arg type="u" name="category" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
       <arg type="a(sb)" name="aids" direction="out" />
     </method>
       <arg type="u" name="type" direction="in" />
       <arg type="u" name="category" direction="in" />
       <arg type="s" name="aid" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
 
       <arg type="u" name="type" direction="in" />
       <arg type="u" name="category" direction="in" />
       <arg type="s" name="aid" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
 
     <method name="UnregisterAids">
       <arg type="u" name="type" direction="in" />
       <arg type="u" name="category" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
 
       <arg type="u" name="category" direction="in" />
       <arg type="b" name="unlock" direction="in" />
       <arg type="u" name="power" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
 
     <method name="RemoveRouteAid">
       <arg type="s" name="package" direction="in" />
       <arg type="s" name="aid" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
 
     -->
     <method name="RemovePackageAids">
       <arg type="s" name="package" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
 
     -->
     <method name="GetRegisteredHandlers">
       <arg type="u" name="category" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
       <arg type="a(s)" name="packages" direction="out" />
     </method>
       <arg type="u" name="handle" direction="in" />
       <arg type="u" name="dev_type" direction="in" />
       <arg type="a(y)" name="data" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
       <arg type="a(y)" name="resp_data" direction="out" />
     </method>
       <arg type="u" name="handle" direction="in" />
       <arg type="u" name="dev_type" direction="in" />
       <arg type="a(y)" name="data" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
   </interface>
     <method name="Request">
       <arg type="u" name="handle" direction="in" />
       <arg type="i" name="type" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
       <arg type="i" name="carrier_type" direction="out" />
       <arg type="a(y)" name="handover_data" direction="out" />
       SimTest
     -->
     <method name="SimTest">
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
 
     <method name="PrbsTest">
       <arg type="u" name="tech" direction="in" />
       <arg type="u" name="rate" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
 
       GetFirmwareVersion
     -->
     <method name="GetFirmwareVersion">
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
       <arg type="s" name="version" direction="out" />
     </method>
       <arg type="u" name="mode" direction="in" />
       <arg type="u" name="reg_id" direction="in" />
       <arg type="a(y)" name="data" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
 
       eseTest
     -->
     <method name="EseTest">
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
 
     <method name="SetSeTechType">
       <arg type="u" name="type" direction="in" />
       <arg type="u" name="tech" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
   </interface>
       <arg type="u" name="sap" direction="in" />
       <arg type="s" name="san" direction="in" />
       <arg type="u" name="user_data" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
 
     <method name="ServerUnregister">
       <arg type="u" name="sap" direction="in" />
       <arg type="s" name="san" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
 
       <arg type="u" name="sap" direction="in" />
       <arg type="s" name="san" direction="in" />
       <arg type="u" name="user_data" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
 
       <arg type="u" name="sap" direction="in" />
       <arg type="s" name="san" direction="in" />
       <arg type="u" name="user_data" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
 
       <arg type="u" name="snep_handle" direction="in" />
       <arg type="u" name="type" direction="in" />
       <arg type="a(y)" name="ndef_msg" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
       <arg type="u" name="type" direction="out" />
       <arg type="a(y)" name="data" direction="out" />
     <method name="StopSnep">
       <arg type="u" name="handle" direction="in" />
       <arg type="u" name="snep_handle" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
 
        StartHceHandler
     -->
     <method name="StartHceHandler">
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
 
        StopHceHandler
     -->
     <method name="StopHceHandler">
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
 
     <method name="ResponseApdu">
       <arg type="u" name="handle" direction="in" />
       <arg type="a(y)" name="data" direction="in" />
-      <arg type="a(y)" name="privilege" direction="in" />
       <arg type="i" name="result" direction="out" />
     </method>
 
index 4dc7b9e..faea782 100755 (executable)
@@ -17,7 +17,7 @@ IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
 ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
 
 # for package file
-SET(dependents "aul glib-2.0 gio-unix-2.0 vconf dlog tapi appsvc libcurl bluetooth-api capi-network-bluetooth openssl deviced feedback capi-media-wav-player mm-keysound syspopup-caller notification capi-network-wifi capi-system-info sqlite3 libprivilege-control")
+SET(dependents "aul glib-2.0 gio-unix-2.0 vconf dlog tapi appsvc libcurl bluetooth-api capi-network-bluetooth openssl deviced feedback capi-media-wav-player mm-keysound syspopup-caller notification capi-network-wifi capi-system-info sqlite3  cynara-client cynara-creds-gdbus cynara-session")
 
 #IF (TIZEN_TELEPHONY_ENABLED)
        #MESSAGE("-DENABLE_TELEPHONY")
@@ -63,6 +63,8 @@ ADD_DEFINITIONS("-DNFC_MANAGER_MODULEDIR=\"${MODULEDIR}\"")
 ADD_DEFINITIONS("-DUSE_FULL_URI")
 #ADD_DEFINITIONS("-DESE_ALWAYS_ON")
 
+ADD_DEFINITIONS("-DUSE_CYNARA")
+
 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
 
 ADD_EXECUTABLE(${NFC_MANAGER_DAEMON} ${MANAGER_SRCS})
index 38966f8..3f5f2d1 100755 (executable)
@@ -54,9 +54,7 @@ void net_nfc_server_gdbus_unregister_on_client_detached_cb(
        net_nfc_server_gdbus_on_client_detached_cb cb);
 
 bool net_nfc_server_gdbus_check_privilege(GDBusMethodInvocation *invocation,
-       GVariant *privilege,
-       const char *object,
-       const char *right);
+       net_nfc_privilege_e privilege);
 
 void net_nfc_server_gdbus_add_client_context(const char *id,
        client_state_e state);
index ef07d94..3bc4388 100755 (executable)
@@ -22,7 +22,6 @@
 #include <dbus/dbus-glib-bindings.h>
 #include <gio/gio.h>
 #include <sys/utsname.h>
-#include <privilege-control.h>
 
 #include <vconf.h>
 
@@ -122,13 +121,6 @@ int main(int argc, char *argv[])
        GError *error = NULL;
        bool check_csc = 0;
 
-       if (getuid() == 0)
-       {
-               int ret = perm_app_set_privilege("system", NULL, NULL);
-               if(ret != 0)
-                       return 0;
-       }
-
        if (!g_thread_supported())
        {
                g_thread_init(NULL);
index 04d6679..2a42b04 100755 (executable)
 #include "net_nfc_server.h"
 #include "net_nfc_server_context_internal.h"
 
+#ifdef USE_CYNARA
+#include "cynara-client.h"
+#include "cynara-creds-gdbus.h"
+#include "cynara-session.h"
+#endif
 
 static GList *client_detached_cbs;
 
@@ -101,20 +106,103 @@ void net_nfc_server_gdbus_unregister_on_client_detached_cb(
        client_detached_cbs = g_list_remove(client_detached_cbs, cb);
 }
 
-/* TODO */
-bool net_nfc_server_gdbus_check_privilege(GDBusMethodInvocation *invocation,
-       GVariant *privilege,
-       const char *object,
-       const char *right)
+#ifdef USE_CYNARA
+static bool _get_credentials(GDBusMethodInvocation *invocation, net_nfc_privilege_e _privilege)
 {
+       int ret = 0;
+       int pid = 0;
+       char *user;
+       char *client;
+       char *client_session;
+       char *privilege = NULL;
+       cynara *p_cynara = NULL;
+       const char *sender_unique_name;
+       GDBusConnection *connection;
+
+       connection = g_dbus_method_invocation_get_connection(invocation);
+       sender_unique_name = g_dbus_method_invocation_get_sender(invocation);
+
+       ret = cynara_initialize(&p_cynara, NULL);
+       if (ret != CYNARA_API_SUCCESS) {
+               DEBUG_SERVER_MSG("cynara_initialize() failed");
+               return false;
+       }
+
+       ret =   cynara_creds_gdbus_get_pid(connection, sender_unique_name, &pid);
+       if (ret != CYNARA_API_SUCCESS) {
+               DEBUG_SERVER_MSG("cynara_creds_gdbus_get_pid() failed");
+               return false;
+       }
+
+       ret = cynara_creds_gdbus_get_user(connection, sender_unique_name, USER_METHOD_DEFAULT, &user);
+       if (ret != CYNARA_API_SUCCESS) {
+               DEBUG_SERVER_MSG("cynara_creds_gdbus_get_user() failed");
+               return false;
+       }
+
+       ret = cynara_creds_gdbus_get_client(connection, sender_unique_name, CLIENT_METHOD_DEFAULT, &client);
+       if (ret != CYNARA_API_SUCCESS) {
+               DEBUG_SERVER_MSG("cynara_creds_gdbus_get_client() failed");
+               return false;
+       }
+
+       switch (_privilege)
+       {
+       case NET_NFC_PRIVILEGE_NFC:
+               privilege = "http://tizen.org/privilege/nfc";
+       break;
+
+       case NET_NFC_PRIVILEGE_NFC_ADMIN :
+               privilege = "http://tizen.org/privilege/nfc.admin";
+       break;
+
+       case NET_NFC_PRIVILEGE_NFC_TAG :
+               privilege = "http://tizen.org/privilege/nfc";
+       break;
+
+       case NET_NFC_PRIVILEGE_NFC_P2P :
+               privilege = "http://tizen.org/privilege/nfc";
+       break;
+
+       case NET_NFC_PRIVILEGE_NFC_CARD_EMUL :
+               privilege = "http://tizen.org/privilege/nfc.cardemulation";
+       break;
+       default :
+               DEBUG_SERVER_MSG("Undifined privilege");
+               return false;
+       break;
+       }
+
+       DEBUG_SERVER_MSG("user :%s , client :%s ,unique_name : %s, pid() : %d, privilege : %d",
+               user, client, sender_unique_name, pid, privilege);
+
+       client_session = cynara_session_from_pid(pid);
+
+
+       ret = cynara_check(p_cynara, client, client_session, user, privilege);
+       if (ret == CYNARA_API_ACCESS_ALLOWED)
+               INFO_MSG("cynara PASS");
+
+       return (ret == CYNARA_API_ACCESS_ALLOWED) ? true : false;
+}
+#endif
+
+bool net_nfc_server_gdbus_check_privilege(GDBusMethodInvocation *invocation, net_nfc_privilege_e privilege)
+{
+       bool ret = true;
+
        const char *id = g_dbus_method_invocation_get_sender(invocation);
 
-       INFO_MSG("check the id of the gdbus sender =  [%s]",id);
+       INFO_MSG("check the id of the gdbus sender = [%s]", id);
 
        net_nfc_server_gdbus_add_client_context(id,
                        NET_NFC_CLIENT_ACTIVE_STATE);
 
-       return true;
+#ifdef USE_CYNARA
+       ret = _get_credentials(invocation, privilege);
+#endif
+
+       return ret;
 }
 
 size_t net_nfc_server_gdbus_get_client_count_no_lock()
index 940947a..11b0dbc 100755 (executable)
@@ -76,10 +76,7 @@ static gboolean handover_handle_request(NetNfcGDbusHandover *hdover,
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::p2p",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_P2P) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
index 9a67911..a6db767 100755 (executable)
@@ -436,10 +436,7 @@ static gboolean hce_handle_start_hce_handler(
        INFO_MSG(">>> REQUEST from [%s]",
                g_dbus_method_invocation_get_sender(invocation));
 
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_CARD_EMUL) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -531,10 +528,7 @@ static gboolean hce_handle_stop_hce_handler(
        INFO_MSG(">>> REQUEST from [%s]",
                g_dbus_method_invocation_get_sender(invocation));
 
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_CARD_EMUL) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -626,10 +620,7 @@ static gboolean hce_handle_response_apdu(
        INFO_MSG(">>> REQUEST from [%s]",
                g_dbus_method_invocation_get_sender(invocation));
 
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_CARD_EMUL) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
index b3b13da..0cebdbe 100755 (executable)
@@ -1191,10 +1191,7 @@ static gboolean llcp_handle_config(NetNfcGDbusLlcp *llcp,
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::p2p",
-               "w") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_P2P) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -1265,10 +1262,7 @@ static gboolean llcp_handle_listen(NetNfcGDbusLlcp *llcp,
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::p2p",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_P2P) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -1334,10 +1328,7 @@ static gboolean llcp_handle_accept(NetNfcGDbusLlcp *llcp,
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::p2p",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_P2P) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -1396,10 +1387,7 @@ static gboolean llcp_handle_reject(NetNfcGDbusLlcp *llcp,
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::p2p",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_P2P) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -1462,10 +1450,7 @@ static gboolean llcp_handle_connect(NetNfcGDbusLlcp *llcp,
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::p2p",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_P2P) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -1534,10 +1519,7 @@ static gboolean llcp_handle_connect_sap(NetNfcGDbusLlcp *llcp,
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::p2p",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_P2P) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -1601,10 +1583,7 @@ static gboolean llcp_handle_send(NetNfcGDbusLlcp *llcp,
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::p2p",
-               "w") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_P2P) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -1670,10 +1649,7 @@ static gboolean llcp_handle_send_to(NetNfcGDbusLlcp *llcp,
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::p2p",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_P2P) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -1739,10 +1715,7 @@ static gboolean llcp_handle_receive(NetNfcGDbusLlcp *llcp,
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::p2p",
-               "w") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_P2P) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -1804,10 +1777,7 @@ static gboolean llcp_handle_receive_from(NetNfcGDbusLlcp *llcp,
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::p2p",
-               "w") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_P2P) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -1868,10 +1838,7 @@ static gboolean llcp_handle_close(NetNfcGDbusLlcp *llcp,
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::p2p",
-               "w") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_P2P) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -1931,10 +1898,7 @@ static gboolean llcp_handle_disconnect(NetNfcGDbusLlcp *llcp,
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::p2p",
-               "w") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_P2P) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
index ae0952e..85bbd8a 100755 (executable)
@@ -235,10 +235,7 @@ static gboolean manager_handle_set_active(NetNfcGDbusManager *manager,
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::admin",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_ADMIN) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -297,10 +294,7 @@ static gboolean manager_handle_get_server_state(NetNfcGDbusManager *manager,
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::admin",
-               "r") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_ADMIN) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
index b8a22ed..586565e 100755 (executable)
@@ -245,10 +245,7 @@ static gboolean ndef_handle_read(NetNfcGDbusNdef *ndef,
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::tag",
-               "r") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_TAG) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -308,10 +305,7 @@ static gboolean ndef_handle_write(NetNfcGDbusNdef *ndef,
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::tag",
-               "w") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_TAG) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -373,10 +367,7 @@ static gboolean ndef_handle_make_read_only(NetNfcGDbusNdef *ndef,
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::tag",
-               "w") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_TAG) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -435,10 +426,7 @@ static gboolean ndef_handle_format(NetNfcGDbusNdef *ndef,
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::tag",
-               "w") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_TAG) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
index f1591c1..2e7c708 100755 (executable)
@@ -98,10 +98,7 @@ static gboolean p2p_handle_send(NetNfcGDbusP2p *p2p,
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::p2p",
-               "w") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_P2P) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
index 8ad6bd3..a8be305 100755 (executable)
@@ -1197,10 +1197,7 @@ static gboolean se_handle_close_secure_element(
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_CARD_EMUL) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -1308,10 +1305,7 @@ static gboolean se_handle_get_atr(
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::ese",
-               "r") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_CARD_EMUL) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -1431,10 +1425,7 @@ static gboolean se_handle_open_secure_element(
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::ese",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_CARD_EMUL) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -1553,10 +1544,7 @@ static gboolean se_handle_send_apdu(
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::ese",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_CARD_EMUL) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -1647,10 +1635,7 @@ static gboolean se_handle_set(
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::card_emul",
-               "w") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_CARD_EMUL) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -1727,10 +1712,7 @@ static gboolean se_handle_get(
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::card_emul",
-               "r") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_CARD_EMUL) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -1813,10 +1795,7 @@ static gboolean se_handle_change_card_emulation_mode(
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::card_emul",
-               "w") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_CARD_EMUL) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -1921,10 +1900,7 @@ static gboolean se_handle_get_card_emulation_mode(
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::card_emul",
-               "r") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_CARD_EMUL) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -1982,10 +1958,7 @@ static gboolean se_handle_set_transaction_fg_dispatch(
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::card_emul",
-               "r") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_CARD_EMUL) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -2065,10 +2038,7 @@ static gboolean se_handle_check_transaction_permission(
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::card_emul",
-               "r") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_CARD_EMUL) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -2157,10 +2127,7 @@ static gboolean se_handle_set_default_route(
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::card_emul",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_CARD_EMUL) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -2274,10 +2241,7 @@ static gboolean se_handle_is_activated_aid_handler(
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::card_emul",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_CARD_EMUL) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -2375,10 +2339,7 @@ static gboolean se_handle_is_activated_category_handler(
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::card_emul",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_CARD_EMUL) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -2488,10 +2449,7 @@ static gboolean se_handle_get_registered_aids(
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::card_emul",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_CARD_EMUL) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -2598,10 +2556,7 @@ static gboolean se_handle_register_aid(
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::card_emul",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_CARD_EMUL) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -2701,10 +2656,7 @@ static gboolean se_handle_unregister_aid(
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::card_emul",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_CARD_EMUL) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -2800,10 +2752,7 @@ static gboolean se_handle_unregister_aids(
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::card_emul",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_CARD_EMUL) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -2895,10 +2844,7 @@ static gboolean se_handle_add_route_aid(
                g_dbus_method_invocation_get_sender(invocation));
 #if 0
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_CARD_EMUL) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -2995,10 +2941,7 @@ static gboolean se_handle_remove_route_aid(
                g_dbus_method_invocation_get_sender(invocation));
 #if 0
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_CARD_EMUL) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -3090,10 +3033,7 @@ static gboolean se_handle_remove_package_aids(
                g_dbus_method_invocation_get_sender(invocation));
 #if 0
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_CARD_EMUL) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -3238,10 +3178,7 @@ static gboolean se_handle_get_registered_handlers(
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::admin",
-               "r") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_CARD_EMUL) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
index c86c332..cc79b05 100755 (executable)
@@ -253,10 +253,7 @@ static gboolean _handle_start_server(
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               arg_privilege,
-               "nfc-manager::p2p",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_P2P) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -406,10 +403,7 @@ static gboolean _handle_start_client(
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               arg_privilege,
-               "nfc-manager::p2p",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_P2P) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -584,10 +578,7 @@ static gboolean _handle_client_send_request(
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               arg_privilege,
-               "nfc-manager::p2p",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_P2P) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -693,10 +684,7 @@ static gboolean _handle_stop_snep(
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               arg_privilege,
-               "nfc-manager::p2p",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_P2P) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -867,10 +855,7 @@ static gboolean _handle_register_server(
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               arg_privilege,
-               "nfc-manager::p2p",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_P2P) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -970,10 +955,7 @@ static gboolean _handle_unregister_server(
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               arg_privilege,
-               "nfc-manager::p2p",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_P2P) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
index 96cddab..46aa745 100755 (executable)
@@ -48,10 +48,7 @@ static gboolean popup_handle_set(NetNfcGDbusPopup *popup_manager,
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::common",
-               "w") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -81,10 +78,7 @@ static gboolean popup_handle_get(NetNfcGDbusPopup *popup_manager,
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::common",
-               "r") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
index 30fc10d..eeaf8d4 100755 (executable)
@@ -639,10 +639,7 @@ static gboolean tag_handle_is_tag_connected(NetNfcGDbusTag *tag,
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::tag",
-               "r") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_TAG) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -680,10 +677,7 @@ static gboolean tag_handle_get_barcode(NetNfcGDbusTag *tag,
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::tag",
-               "r") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_TAG) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -741,10 +735,7 @@ static gboolean tag_handle_get_current_tag_info(NetNfcGDbusTag *tag,
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::tag",
-               "r") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_TAG) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -815,10 +806,7 @@ static gboolean tag_handle_get_current_target_handle(NetNfcGDbusTag *tag,
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::p2p",
-               "r") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_P2P) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
index dbe0478..acfd319 100755 (executable)
@@ -233,10 +233,7 @@ static gboolean test_handle_sim_test(NetNfcGDbusTest *test,
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -296,10 +293,7 @@ static gboolean test_handle_prbs_test(NetNfcGDbusTest *test,
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -359,10 +353,7 @@ static gboolean test_handle_get_firmware_version(NetNfcGDbusTest *test,
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -424,10 +415,7 @@ static gboolean test_handle_set_ee_data(NetNfcGDbusTest *test,
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -486,10 +474,7 @@ static gboolean test_handle_ese_test(NetNfcGDbusTest *test,
                g_dbus_method_invocation_get_sender(invocation));
 #if 0
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -571,10 +556,7 @@ static gboolean test_handle_set_se_tech_type(NetNfcGDbusTest *test,
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
index d2ab79e..bb42f05 100755 (executable)
@@ -132,10 +132,7 @@ static gboolean transceive_data_handle(NetNfcGDbusTransceive *transceive,
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::tag",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_P2P) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;
 
@@ -259,10 +256,7 @@ static gboolean transceive_handle(NetNfcGDbusTransceive *transceive,
                g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
-       if (net_nfc_server_gdbus_check_privilege(invocation,
-               smack_privilege,
-               "nfc-manager::tag",
-               "rw") == false) {
+       if (net_nfc_server_gdbus_check_privilege(invocation, NET_NFC_PRIVILEGE_NFC_P2P) == false) {
                DEBUG_ERR_MSG("permission denied, and finished request");
                result = NET_NFC_PERMISSION_DENIED;