org.springmodules.validation.valang.functions
Class InRoleFunction
java.lang.Object
org.springmodules.validation.valang.functions.AbstractFunction
org.springmodules.validation.valang.functions.InRoleFunction
- All Implemented Interfaces:
- Function
public class InRoleFunction
- extends AbstractFunction
A function that accepts a one string argument that indicates a security role. This function
returns a true
if the current user is in the passed in role, and false
otherwise.
This method uses Acegi's SecurityContextHolder.getContext().getAuthentication()
to
get the current user.
This function may be used to apply different validation rules based on the logged in user roles.
- Since:
- May 25, 2006
- Author:
- Uri Boness
Methods inherited from class org.springmodules.validation.valang.functions.AbstractFunction |
definedExactNumberOfArguments, definedMaxNumberOfArguments, definedMinNumberOfArguments, getArguments, getResult, getTemplate, init, isAutowireByName, isAutowireByType, setArguments, setTemplate, setTemplate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
InRoleFunction
public InRoleFunction(Function[] arguments,
int line,
int column)
doGetResult
protected Object doGetResult(Object target)
- Description copied from class:
AbstractFunction
- Processes result for subclasses.
- Specified by:
doGetResult
in class AbstractFunction
Copyright © 2009. All Rights Reserved.