X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2FCommons%2FFunctionDeclaration.h;h=23d33229e49d8b9b603765b11dc2e8598eb66e24;hb=da854ef348cf918993a95adeeffa616db2dca6f7;hp=f93db5096e386d1a6620ebfd30da3613104d133f;hpb=9c61c076f198660f9d9683fc1f091cbc95b3286b;p=framework%2Fweb%2Fwrt-plugins-common.git diff --git a/src/Commons/FunctionDeclaration.h b/src/Commons/FunctionDeclaration.h index f93db50..23d3322 100644 --- a/src/Commons/FunctionDeclaration.h +++ b/src/Commons/FunctionDeclaration.h @@ -19,10 +19,11 @@ #include #include #include -#include +#include #include #include #include +#include #define ACE_DECLARE_FUNCTION(function_definition) \ extern WrtDeviceApis::Commons::AceFunction ace_ ## function_definition @@ -132,23 +133,18 @@ template 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; }