use of com.evolveum.midpoint.schema.expression.ScriptExpressionProfile in project midpoint by Evolveum.
the class SandboxTypeCheckingExtension method decideClass.
private AccessDecision decideClass(String className, String methodName) {
AccessDecision decision = GroovyScriptEvaluator.decideGroovyBuiltin(className, methodName);
LOGGER.trace("decideClass: builtin [{},{}] : {}", className, methodName, decision);
if (decision != AccessDecision.DEFAULT) {
return decision;
}
ScriptExpressionProfile scriptExpressionProfile = getContext().getScriptExpressionProfile();
if (scriptExpressionProfile == null) {
LOGGER.trace("decideClass: profile==null [{},{}] : ALLOW", className, methodName);
return AccessDecision.ALLOW;
}
decision = scriptExpressionProfile.decideClassAccess(className, methodName);
LOGGER.trace("decideClass: profile({}) [{},{}] : {}", getContext().getExpressionProfile().getIdentifier(), className, methodName, decision);
return decision;
}
use of com.evolveum.midpoint.schema.expression.ScriptExpressionProfile in project midpoint by Evolveum.
the class GroovyScriptEvaluator method getGroovyLoader.
private GroovyClassLoader getGroovyLoader(ScriptExpressionEvaluationContext context) throws SecurityViolationException {
GroovyClassLoader groovyClassLoader = getScriptCache().getInterpreter(context.getExpressionProfile());
if (groovyClassLoader != null) {
return groovyClassLoader;
}
ScriptExpressionProfile scriptExpressionProfile = context.getScriptExpressionProfile();
groovyClassLoader = createGroovyLoader(scriptExpressionProfile, context);
getScriptCache().putInterpreter(context.getExpressionProfile(), groovyClassLoader);
return groovyClassLoader;
}
Aggregations