summaryrefslogtreecommitdiff
path: root/src/data_control_sql.c
diff options
context:
space:
mode:
authorjk7744.park <jk7744.park@samsung.com>2015-10-24 16:22:53 +0900
committerjk7744.park <jk7744.park@samsung.com>2015-10-24 16:22:53 +0900
commitf709d2887a77e89ba37765c90285c3a82d323547 (patch)
tree2c378eff41333da862f045a8f7df7f3e116567b3 /src/data_control_sql.c
parent52a4f7f9e6b9d2fe295cf62f63e2b52d54576ee6 (diff)
downloaddata-control-accepted/tizen_2.4_mobile.tar.gz
data-control-accepted/tizen_2.4_mobile.tar.bz2
data-control-accepted/tizen_2.4_mobile.zip
Diffstat (limited to 'src/data_control_sql.c')
-rw-r--r--src/data_control_sql.c44
1 files changed, 10 insertions, 34 deletions
diff --git a/src/data_control_sql.c b/src/data_control_sql.c
index d62daed..e1c03e7 100644
--- a/src/data_control_sql.c
+++ b/src/data_control_sql.c
@@ -181,14 +181,9 @@ data_control_sql_insert(data_control_h provider, const bundle* insert_data, int
{
int retval;
- retval = check_privilege(PRIVILEGE_DATA_SHARING);
+ retval = data_control_consumer_check_privilege();
if (retval != DATA_CONTROL_ERROR_NONE) {
- return data_control_error(retval, __FUNCTION__, "failed to allow privilege");
- }
-
- retval = check_privilege(PRIVILEGE_APP_MANAGER_LAUNCH);
- if (retval != DATA_CONTROL_ERROR_NONE) {
- return data_control_error(retval, __FUNCTION__, "failed to allow privilege");
+ return retval;
}
return datacontrol_sql_insert((datacontrol_h)provider, insert_data, request_id);
@@ -199,14 +194,9 @@ data_control_sql_delete(data_control_h provider, const char *where, int *request
{
int retval;
- retval = check_privilege(PRIVILEGE_DATA_SHARING);
+ retval = data_control_consumer_check_privilege();
if (retval != DATA_CONTROL_ERROR_NONE) {
- return data_control_error(retval, __FUNCTION__, "failed to allow privilege");
- }
-
- retval = check_privilege(PRIVILEGE_APP_MANAGER_LAUNCH);
- if (retval != DATA_CONTROL_ERROR_NONE) {
- return data_control_error(retval, __FUNCTION__, "failed to allow privilege");
+ return retval;
}
return datacontrol_sql_delete((datacontrol_h)provider, where, request_id);
@@ -217,14 +207,9 @@ data_control_sql_select(data_control_h provider, char **column_list, int column_
{
int retval;
- retval = check_privilege(PRIVILEGE_DATA_SHARING);
- if (retval != DATA_CONTROL_ERROR_NONE) {
- return data_control_error(retval, __FUNCTION__, "failed to allow privilege");
- }
-
- retval = check_privilege(PRIVILEGE_APP_MANAGER_LAUNCH);
+ retval = data_control_consumer_check_privilege();
if (retval != DATA_CONTROL_ERROR_NONE) {
- return data_control_error(retval, __FUNCTION__, "failed to allow privilege");
+ return retval;
}
return datacontrol_sql_select((datacontrol_h)provider, column_list, column_count, where, order, request_id);
@@ -239,14 +224,10 @@ data_control_sql_select_with_page(data_control_h provider, char **column_list, i
{
return DATA_CONTROL_ERROR_INVALID_PARAMETER;
}
- retval = check_privilege(PRIVILEGE_DATA_SHARING);
- if (retval != DATA_CONTROL_ERROR_NONE) {
- return data_control_error(retval, __FUNCTION__, "failed to allow privilege");
- }
- retval = check_privilege(PRIVILEGE_APP_MANAGER_LAUNCH);
+ retval = data_control_consumer_check_privilege();
if (retval != DATA_CONTROL_ERROR_NONE) {
- return data_control_error(retval, __FUNCTION__, "failed to allow privilege");
+ return retval;
}
return datacontrol_sql_select_with_page((datacontrol_h)provider, column_list, column_count, where, order, page_number, count_per_page, request_id);
@@ -258,14 +239,9 @@ data_control_sql_update(data_control_h provider, const bundle* update_data, cons
{
int retval;
- retval = check_privilege(PRIVILEGE_DATA_SHARING);
- if (retval != DATA_CONTROL_ERROR_NONE) {
- return data_control_error(retval, __FUNCTION__, "failed to allow privilege");
- }
-
- retval = check_privilege(PRIVILEGE_APP_MANAGER_LAUNCH);
+ retval = data_control_consumer_check_privilege();
if (retval != DATA_CONTROL_ERROR_NONE) {
- return data_control_error(retval, __FUNCTION__, "failed to allow privilege");
+ return retval;
}
return datacontrol_sql_update((datacontrol_h)provider, update_data, where, request_id);