org.springmodules.validation.valang.functions
Class InRoleFunction

java.lang.Object
  extended by org.springmodules.validation.valang.functions.AbstractFunction
      extended by 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

Constructor Summary
InRoleFunction(Function[] arguments, int line, int column)
           
 
Method Summary
protected  Object doGetResult(Object target)
          Processes result for subclasses.
 
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
 

Constructor Detail

InRoleFunction

public InRoleFunction(Function[] arguments,
                      int line,
                      int column)
Method Detail

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.