use of org.xwiki.rendering.macro.script.MacroPermissionPolicy in project xwiki-platform by xwiki.
the class DefaultScriptMacroPermissionPolicy method hasPermission.
@Override
public boolean hasPermission(ScriptMacroParameters parameters, MacroTransformationContext context) {
boolean hasPermission;
try {
MacroPermissionPolicy policy = this.componentManager.getInstance(MacroPermissionPolicy.class, ((DefaultScriptMacroParameters) parameters).getLanguage());
hasPermission = policy.hasPermission(parameters, context);
} catch (ComponentLookupException e) {
// No policy for that Macro, use the default implementation which forbids execution if the doc doesn't
// have Programming Rights.
hasPermission = super.hasPermission(parameters, context);
}
return hasPermission;
}
Aggregations