Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

net.sf.acegisecurity.acl.basic
Class GrantedAuthorityEffectiveAclsResolver  view GrantedAuthorityEffectiveAclsResolver download GrantedAuthorityEffectiveAclsResolver.java

java.lang.Object
  extended bynet.sf.acegisecurity.acl.basic.GrantedAuthorityEffectiveAclsResolver
All Implemented Interfaces:
EffectiveAclsResolver

public class GrantedAuthorityEffectiveAclsResolver
extends java.lang.Object
implements EffectiveAclsResolver

Simple implementation of EffectiveAclsResolver.

This implementation does not need to understand the "recipient" types presented in a BasicAclEntry because it merely delegates to the detected Authentication.getPrincipal()>Authentication.getPrincipal() 55 or Authentication.getAuthorities()>Authentication.getAuthorities() 55 . The principal object or granted authorities object has its Object.equals(recipient) method called to make the decision as to whether the recipient in the BasicAclEntry is the same as the principal or granted authority.

This class should prove an adequate ACLs resolver if you're using standard Acegi Security classes. This is because the typical Authentication token is UsernamePasswordAuthenticationToken, which for its principal is usually a String. The GrantedAuthorityImpl is typically used for granted authorities, which tests for equality based on a String. This means BasicAclDaos simply need to return a String to represent the recipient. If you use non-String objects, you will probably require an alternative EffectiveAclsResolver.

Version:
$Id: GrantedAuthorityEffectiveAclsResolver.java,v 1.3 2004/11/15 01:40:18 benalex Exp $

Field Summary
private static org.apache.commons.logging.Log logger
           
 
Constructor Summary
GrantedAuthorityEffectiveAclsResolver()
           
 
Method Summary
 net.sf.acegisecurity.acl.AclEntry[] resolveEffectiveAcls(net.sf.acegisecurity.acl.AclEntry[] allAcls, net.sf.acegisecurity.Authentication filteredBy)
          Determines the ACLs that apply to the presented Authentication object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final org.apache.commons.logging.Log logger
Constructor Detail

GrantedAuthorityEffectiveAclsResolver

public GrantedAuthorityEffectiveAclsResolver()
Method Detail

resolveEffectiveAcls

public net.sf.acegisecurity.acl.AclEntry[] resolveEffectiveAcls(net.sf.acegisecurity.acl.AclEntry[] allAcls,
                                                                net.sf.acegisecurity.Authentication filteredBy)
Description copied from interface: EffectiveAclsResolver
Determines the ACLs that apply to the presented Authentication object.

Specified by:
resolveEffectiveAcls in interface EffectiveAclsResolver