[systemsetting] - Checking privileges moved to JS layer
authorAndrzej Popowski <a.popowski@samsung.com>
Thu, 30 Apr 2015 12:35:34 +0000 (14:35 +0200)
committerPawel Andruszkiewicz <p.andruszkie@samsung.com>
Mon, 4 May 2015 07:28:22 +0000 (16:28 +0900)
Change-Id: I6abba4cf96b528bd0c46b65619231f9f6d8c4f4d
Signed-off-by: Andrzej Popowski <a.popowski@samsung.com>
src/systemsetting/systemsetting_api.js
src/systemsetting/systemsetting_instance.cc

index 7cf25ed..6029d37 100644 (file)
@@ -6,6 +6,7 @@
 
 
 var validator_ = xwalk.utils.validator;
+var privilege_ = xwalk.utils.privilege;
 var type_ = xwalk.utils.type;
 var types_ = validator_.Types;
 var native_ = new xwalk.utils.NativeManager(extension);
@@ -51,6 +52,8 @@ SystemSettingManager.prototype.getProperty = function() {
 };
 
 SystemSettingManager.prototype.setProperty = function() {
+    xwalk.utils.checkPrivilegeAccess(privilege_.SETTING);
+
     var args = validator_.validateArgs(arguments, [
         { name: 'type', type: types_.ENUM, values: SystemSettingTypeValues },
         { name: 'value', type: types_.STRING },
index 70b9842..8dc7273 100644 (file)
@@ -21,8 +21,6 @@ const std::string SETTING_HOME_SCREEN = "HOME_SCREEN";
 const std::string SETTING_LOCK_SCREEN = "LOCK_SCREEN";
 const std::string SETTING_INCOMING_CALL = "INCOMING_CALL";
 const std::string SETTING_NOTIFICATION_EMAIL = "NOTIFICATION_EMAIL";
-
-const std::string kPrivilegeSetting = "http://tizen.org/privilege/setting";
 }
 
 using namespace common;
@@ -120,8 +118,6 @@ void SystemSettingInstance::setProperty(const picojson::value& args, picojson::o
 {
   LoggerD("");
 
-  CHECK_PRIVILEGE_ACCESS(kPrivilegeSetting, &out);
-
   const double callback_id = args.get("callbackId").get<double>();
 
   const std::string& type = args.get("type").get<std::string>();