#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
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;
}