com.zeevbelkin.web.filter.access
Interface Yaaf.RoleResolver

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
Yaaf.SessionSecurityInfo
Enclosing class:
Yaaf

public static interface Yaaf.RoleResolver
extends java.io.Serializable

SessionSecurityInfo allows to set to an authenticated user a particular resolver. A class that implements such resolver should implements this interface. For example:

     Yaaf.SessionSecurityInfo ssi=(Yaaf.SessionSecurityInfo)request.getUserPrincipal();
     ....
     ssi.setName("foo");
     ssi.setRoleResolver(
        new Yaaf.RoleResolver() {
          public  boolean isUserInRole(String role) {
           return role.equals("admin")||role.equals("role1");
         }
       }
     );
 


Method Summary
 boolean isUserInRole(java.lang.String role)
          checks if a user has a role
 

Method Detail

isUserInRole

boolean isUserInRole(java.lang.String role)
checks if a user has a role

Parameters:
role - the role to check
Returns:
true if the user has the role