use of com.evolveum.midpoint.schema.expression.ExpressionPermissionProfile in project midpoint by Evolveum.
the class ScriptExpression method formatProfile.
private String formatProfile() {
StringBuilder sb = new StringBuilder();
if (expressionProfile != null) {
sb.append(expressionProfile.getIdentifier());
} else {
sb.append("null (no profile)");
}
if (scriptExpressionProfile != null) {
sb.append("; ");
ExpressionPermissionProfile permissionProfile = scriptExpressionProfile.getPermissionProfile();
if (permissionProfile != null) {
sb.append("permission=").append(permissionProfile.getIdentifier());
}
}
return sb.toString();
}
use of com.evolveum.midpoint.schema.expression.ExpressionPermissionProfile in project midpoint by Evolveum.
the class ExpressionProfileCompiler method compilePermissionProfile.
private ExpressionPermissionProfile compilePermissionProfile(ExpressionPermissionProfileType permissionProfileType) {
ExpressionPermissionProfile profile = new ExpressionPermissionProfile(permissionProfileType.getIdentifier());
profile.setDecision(AccessDecision.translate(permissionProfileType.getDecision()));
profile.getPackageProfiles().addAll(permissionProfileType.getPackage());
profile.getClassProfiles().addAll(permissionProfileType.getClazz());
return profile;
}
use of com.evolveum.midpoint.schema.expression.ExpressionPermissionProfile in project midpoint by Evolveum.
the class ExpressionProfileCompiler method compile.
public ExpressionProfiles compile(SystemConfigurationExpressionsType expressionsType) throws SchemaException {
List<ExpressionPermissionProfile> permissionProfiles = compilePermissionProfiles(expressionsType.getPermissionProfile());
ExpressionProfiles expressionProfiles = compileExpressionProfiles(expressionsType.getExpressionProfile(), permissionProfiles);
return expressionProfiles;
}
use of com.evolveum.midpoint.schema.expression.ExpressionPermissionProfile in project midpoint by Evolveum.
the class TestGroovyExpressionsSandbox method getScriptExpressionProfile.
@Override
protected ScriptExpressionProfile getScriptExpressionProfile(String language) {
ScriptExpressionProfile profile = new ScriptExpressionProfile(language);
profile.setTypeChecking(true);
ExpressionPermissionProfile permissionProfile = new ExpressionPermissionProfile(this.getClass().getSimpleName());
profile.setPermissionProfile(permissionProfile);
permissionProfile.addClassAccessRule(Poison.class, AccessDecision.ALLOW);
permissionProfile.addClassAccessRule(Poison.class, "smell", AccessDecision.DENY);
permissionProfile.addClassAccessRule(Poison.class, "drink", AccessDecision.DENY);
permissionProfile.addClassAccessRule(String.class, AccessDecision.ALLOW);
permissionProfile.addClassAccessRule(String.class, "execute", AccessDecision.DENY);
permissionProfile.addClassAccessRule(List.class, AccessDecision.ALLOW);
permissionProfile.addClassAccessRule(List.class, "execute", AccessDecision.DENY);
permissionProfile.setDecision(AccessDecision.ALLOW);
return profile;
}
Aggregations