org.xwiki.rendering.internal.macro.velocity
Class VelocityMacroPermissionPolicy

java.lang.Object
  extended by org.xwiki.rendering.macro.script.AbstractScriptMacroPermissionPolicy
      extended by org.xwiki.rendering.internal.macro.velocity.VelocityMacroPermissionPolicy
All Implemented Interfaces:
MacroPermissionPolicy

@Component
@Named(value="velocity")
@Singleton
public class VelocityMacroPermissionPolicy
extends AbstractScriptMacroPermissionPolicy

Decide if velocity script execution is allowed. Allow execution if one of the following conditions is met:

Since:
4.2M1

Constructor Summary
VelocityMacroPermissionPolicy()
           
 
Method Summary
 boolean hasPermission(ScriptMacroParameters parameters, MacroTransformationContext context)
          Verifies if the current execution Script Macro is allowed to execute its content or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VelocityMacroPermissionPolicy

public VelocityMacroPermissionPolicy()
Method Detail

hasPermission

public boolean hasPermission(ScriptMacroParameters parameters,
                             MacroTransformationContext context)
Description copied from interface: MacroPermissionPolicy
Verifies if the current execution Script Macro is allowed to execute its content or not.

Specified by:
hasPermission in interface MacroPermissionPolicy
Overrides:
hasPermission in class AbstractScriptMacroPermissionPolicy
Parameters:
parameters - the executing macro parameters
context - the transformation context in which the current macro is executing
Returns:
true if the script can execute or false otherwise