upload tizen1.0 source
[framework/web/wrt-plugins-common.git] / src / Commons / FunctionDeclaration.h
index f93db50..23d3322 100644 (file)
 #include <string>
 #include <algorithm>
 #include <dpl/log/log.h>
-#include <Commons/WrtWrapper/WrtWrappersMgr.h>
+#include <Commons/WrtAccess/WrtAccess.h>
 #include <Commons/Exception.h>
 #include <Commons/TypesDeclaration.h>
 #include <Commons/TypeTraits.h>
+#include <Commons/plugin_initializer_def.h>
 
 #define ACE_DECLARE_FUNCTION(function_definition) \
     extern WrtDeviceApis::Commons::AceFunction ace_ ## function_definition
@@ -132,23 +133,18 @@ template <typename FunctionGetter,
           typename ArgumentsVerifier,
           typename ... Args>
 AceSecurityStatus aceCheckAccess(
-        JavaScriptContext globalContext,
         const FunctionGetter& f,
         const char* functionName,
         Args && ... args)
 {
+    using namespace WrtDeviceApis::Commons;
+
     AceFunction aceFunction = f(functionName);
 
     ArgumentsVerifier argsVerify;
     argsVerify(aceFunction, args ...);
 
-    IWrtWrapperPtr wrapper =
-        WrtWrappersMgr::getInstance().getWrtWrapper(globalContext);
-    if (!wrapper) {
-        LogError("Wrapper doesn't exist.");
-        return AceSecurityStatus::InternalError;
-    }
-    if (!(wrapper->checkAccess(aceFunction))) {
+    if (!(WrtAccessSingleton::Instance().checkAccessControl(aceFunction))) {
         LogDebug("Function is not allowed to run");
         return AceSecurityStatus::AccessDenied;
     }