|
Spring Security Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.security.acl.basic.BasicAclProvider
public class BasicAclProvider
Retrieves access control lists (ACL) entries for domain object instances from a data access object (DAO).
This implementation will provide ACL lookup services for any object that it can determine the AclObjectIdentity
for by calling the obtainIdentity(Object)
method. Subclasses can override this method
if they only want the BasicAclProvider
responding to particular domain object instances.
BasicAclProvider
will walk an inheritance hierarchy if a BasicAclEntry
returned by
the DAO indicates it has a parent. NB: inheritance occurs at a domain instance object level. It does not
occur at an ACL recipient level. This means allBasicAclEntry
s for a given domain instance
object must have the same parent identity, or allBasicAclEntry
s must have
null
as their parent identity.
A cache should be used. This is provided by the BasicAclEntryCache
. BasicAclProvider
by
default is setup to use the NullAclEntryCache
, which performs no caching.
To implement the getAcls(Object, Authentication)
method, BasicAclProvider
requires a
EffectiveAclsResolver
to be configured against it. By default the GrantedAuthorityEffectiveAclsResolver
is used.
Constructor Summary | |
---|---|
BasicAclProvider()
Deprecated. |
Method Summary | |
---|---|
void |
afterPropertiesSet()
Deprecated. |
AclEntry[] |
getAcls(Object domainInstance)
Deprecated. Obtains the ACLs that apply to the specified domain instance. |
AclEntry[] |
getAcls(Object domainInstance,
Authentication authentication)
Deprecated. Obtains the ACLs that apply to the specified domain instance and presented Authentication
object. |
BasicAclDao |
getBasicAclDao()
Deprecated. |
BasicAclEntryCache |
getBasicAclEntryCache()
Deprecated. |
Class |
getDefaultAclObjectIdentityClass()
Deprecated. |
EffectiveAclsResolver |
getEffectiveAclsResolver()
Deprecated. |
Class |
getRestrictSupportToClass()
Deprecated. |
protected AclObjectIdentity |
obtainIdentity(Object domainInstance)
Deprecated. This method looks up the AclObjectIdentity of a passed domain object instance. |
void |
setBasicAclDao(BasicAclDao basicAclDao)
Deprecated. |
void |
setBasicAclEntryCache(BasicAclEntryCache basicAclEntryCache)
Deprecated. |
void |
setDefaultAclObjectIdentityClass(Class defaultAclObjectIdentityClass)
Deprecated. Allows selection of the AclObjectIdentity class that an attempt should be made to construct
if the passed object does not implement AclObjectIdentityAware . |
void |
setEffectiveAclsResolver(EffectiveAclsResolver effectiveAclsResolver)
Deprecated. |
void |
setRestrictSupportToClass(Class restrictSupportToClass)
Deprecated. If set to a value other than null , the supports(Object) method will only
support the indicates class. |
boolean |
supports(Object domainInstance)
Deprecated. Indicates support for the passed object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BasicAclProvider()
Method Detail |
---|
public void afterPropertiesSet()
afterPropertiesSet
in interface InitializingBean
public AclEntry[] getAcls(Object domainInstance)
AclProvider
Will never be called unless the AclProvider.supports(Object)
method returned true
.
getAcls
in interface AclProvider
domainInstance
- the instance for which ACL information is required (never null
)
null
if no ACLs apply to the specified domain instancepublic AclEntry[] getAcls(Object domainInstance, Authentication authentication)
AclProvider
Authentication
object.Will never be called unless the AclProvider.supports(Object)
method returned true
.
getAcls
in interface AclProvider
domainInstance
- the instance for which ACL information is required (never null
)authentication
- the prncipal for which ACL information should be filtered (never null
)
null
) if no such ACLs are foundpublic BasicAclDao getBasicAclDao()
public BasicAclEntryCache getBasicAclEntryCache()
public Class getDefaultAclObjectIdentityClass()
public EffectiveAclsResolver getEffectiveAclsResolver()
public Class getRestrictSupportToClass()
protected AclObjectIdentity obtainIdentity(Object domainInstance)
AclObjectIdentity
of a passed domain object instance.This
implementation attempts to obtain the AclObjectIdentity
via reflection inspection of the class for
the AclObjectIdentityAware
interface. If this fails, an attempt is made to construct a getDefaultAclObjectIdentityClass()
object by passing the domain instance object into its constructor.
domainInstance
- the domain object instance (never null
)
null
if one could not be obtainedpublic void setBasicAclDao(BasicAclDao basicAclDao)
public void setBasicAclEntryCache(BasicAclEntryCache basicAclEntryCache)
public void setDefaultAclObjectIdentityClass(Class defaultAclObjectIdentityClass)
AclObjectIdentity
class that an attempt should be made to construct
if the passed object does not implement AclObjectIdentityAware
.NB: Any
defaultAclObjectIdentityClass
must provide a public constructor that accepts an
Object
. Otherwise it is not possible for the BasicAclProvider
to try to create the
AclObjectIdentity
instance at runtime.
defaultAclObjectIdentityClass
- public void setEffectiveAclsResolver(EffectiveAclsResolver effectiveAclsResolver)
public void setRestrictSupportToClass(Class restrictSupportToClass)
null
, the supports(Object)
method will only
support the indicates class. This is useful if you wish to wire multiple BasicAclProvider
s in a
list of AclProviderManager.providers
but only have particular instances respond to particular
domain object types.
restrictSupportToClass
- the class to restrict this BasicAclProvider
to service request for,
or null
(the default) if the BasicAclProvider
should respond to every class
presentedpublic boolean supports(Object domainInstance)
An object will only be supported if it (i) is allowed to be
supported as defined by the setRestrictSupportToClass(Class)
method, and (ii) if an
AclObjectIdentity
is returned by obtainIdentity(Object)
for that object.
supports
in interface AclProvider
domainInstance
- the instance to check
true
if this provider supports the passed object, false
otherwise
|
Spring Security Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |