org.apache.click.extras.security
Class RoleAccessController

java.lang.Object
  extended by org.apache.click.extras.security.RoleAccessController
All Implemented Interfaces:
AccessController

public class RoleAccessController
extends Object
implements AccessController

Provides a Role based access controller class. This access controller uses the JEE servlet container to determine whether an authenticated user has access to a specified role.

This class is used as the default AccessController by the Menu class.


Constructor Summary
RoleAccessController()
           
 
Method Summary
 boolean hasAccess(HttpServletRequest request, String role)
          Return true if the user is in the specified security access role.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoleAccessController

public RoleAccessController()
Method Detail

hasAccess

public boolean hasAccess(HttpServletRequest request,
                         String role)
Return true if the user is in the specified security access role.

Please note: if role is null this method returns true, meaning user has access to resources without roles defined.

Specified by:
hasAccess in interface AccessController
Parameters:
request - the user request
role - the security access role to check
Returns:
true if the user is in the specified role
See Also:
AccessController.hasAccess(HttpServletRequest, String)