upload tizen1.0 source
[platform/framework/web/wrt-plugins-common.git] / src / CommonsJavaScript / Security / SecurityFunctionDeclaration.h
index e3305a9..ad93dd8 100644 (file)
@@ -17,7 +17,7 @@
 #define _FUNCTION_DECLARATION_
 
 #include <string>
-#include <Commons/WrtWrapper/WrtWrappersMgr.h>
+#include <Commons/WrtAccess/WrtAccess.h>
 #include <Commons/Exception.h>
 #include <JavaScriptCore/JavaScript.h>
 #include <Commons/TypesDeclaration.h>
@@ -58,25 +58,23 @@ class DefaultArgsVerifier<>
 
 template <typename ArgumentsVerifier,
           typename ... Args>
-AceSecurityStatus aceCheckAccess2(JSContextRef globalContext,
-        WrtDeviceApis::Commons::AceFunction  aceFunction,
+AceSecurityStatus aceCheckAccess2(
+        WrtDeviceApis::Commons::AceFunction aceFunction,
         Args && ... args)
 {
+    using namespace WrtDeviceApis::Commons;
+
     ArgumentsVerifier argsVerify;
     argsVerify(aceFunction, args ...);
 
     Try {
-        WrtDeviceApis::Commons::IWrtWrapperPtr wrapper =
-        WrtDeviceApis::Commons::WrtWrappersMgr::getInstance().getWrtWrapper(
-            globalContext);
-
-        if (!(wrapper->checkAccess(aceFunction))) {
+        if (!(WrtAccessSingleton::Instance().checkAccessControl(aceFunction))) {
         LogDebug("Function is not allowed to run");
         return AceSecurityStatus::AccessDenied;
         }
     }
     Catch(WrtDeviceApis::Commons::OutOfRangeException) {
-        LogError("Wrapper doesn't exist.");
+        LogError("WrtAccess doesn't exist.");
         return AceSecurityStatus::InternalError;
     }
 
@@ -88,8 +86,8 @@ AceSecurityStatus aceCheckAccess2(JSContextRef globalContext,
 
 
 //The simplest version
-AceSecurityStatus aceCheckAccessSimple(JSContextRef globalContext,
-        WrtDeviceApis::Commons::AceFunction  aceFunction);
+AceSecurityStatus aceCheckAccessSimple(
+        WrtDeviceApis::Commons::AceFunction aceFunction);
 
 }
 }