#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>
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;
}
//The simplest version
-AceSecurityStatus aceCheckAccessSimple(JSContextRef globalContext,
- WrtDeviceApis::Commons::AceFunction aceFunction);
+AceSecurityStatus aceCheckAccessSimple(
+ WrtDeviceApis::Commons::AceFunction aceFunction);
}
}