|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.acegisecurity.acl.basic.AbstractBasicAclEntry
public abstract class AbstractBasicAclEntry
Abstract implementation of BasicAclEntry.
Provides core bit mask handling methods.
| Constructor Summary | |
|---|---|
protected |
AbstractBasicAclEntry()
A protected constructor for use by Hibernate. |
|
AbstractBasicAclEntry(Object recipient,
AclObjectIdentity aclObjectIdentity,
AclObjectIdentity aclObjectParentIdentity,
int mask)
|
| Method Summary | |
|---|---|
int |
addPermission(int permissionToAdd)
|
int |
addPermissions(int[] permissionsToAdd)
|
int |
deletePermission(int permissionToDelete)
|
int |
deletePermissions(int[] permissionsToDelete)
|
AclObjectIdentity |
getAclObjectIdentity()
Indicates the domain object instance that is subject of this BasicAclEntry. |
AclObjectIdentity |
getAclObjectParentIdentity()
Indicates any ACL parent of the domain object instance. |
int |
getMask()
Access control lists in this package are based on bit masking. |
Object |
getRecipient()
A domain object instance will usually have multiple BasicAclEntrys. |
abstract int[] |
getValidPermissions()
Subclasses must indicate the permissions they support. |
boolean |
isPermitted(int permissionToCheck)
Determine if the mask of this entry includes this permission or not |
protected boolean |
isPermitted(int maskToCheck,
int permissionToCheck)
|
String |
printPermissionsBlock()
Outputs the permissions in human-friendly format for the current AbstractBasicAclEntry's mask. |
abstract String |
printPermissionsBlock(int i)
Outputs the permissions in a human-friendly format. |
void |
setAclObjectIdentity(AclObjectIdentity aclObjectIdentity)
This setter should only be used by DAO implementations. |
void |
setAclObjectParentIdentity(AclObjectIdentity aclObjectParentIdentity)
This setter should only be used by DAO implementations. |
void |
setMask(int mask)
This setter should only be used by DAO implementations. |
void |
setRecipient(Object recipient)
This setter should only be used by DAO implementations. |
int |
togglePermission(int permissionToToggle)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractBasicAclEntry(Object recipient,
AclObjectIdentity aclObjectIdentity,
AclObjectIdentity aclObjectParentIdentity,
int mask)
protected AbstractBasicAclEntry()
| Method Detail |
|---|
public void setAclObjectIdentity(AclObjectIdentity aclObjectIdentity)
BasicAclEntry
setAclObjectIdentity in interface BasicAclEntryaclObjectIdentity - an object which can be used to uniquely
identify the domain object instance subject of this ACL entrypublic AclObjectIdentity getAclObjectIdentity()
BasicAclEntryBasicAclEntry. This information may be of interest to
relying classes (voters and business methods) that wish to know the
actual origination of the ACL entry (so as to distinguish individual
ACL entries from others contributed by the inheritance hierarchy).
getAclObjectIdentity in interface BasicAclEntrynull)public void setAclObjectParentIdentity(AclObjectIdentity aclObjectParentIdentity)
BasicAclEntry
setAclObjectParentIdentity in interface BasicAclEntryaclObjectParentIdentity - an object which represents the parent of
the domain object instance subject of this ACL entry, or
null if either the domain object instance has no
parent or its parent should be not used to compute an
inheritance hierarchypublic AclObjectIdentity getAclObjectParentIdentity()
BasicAclEntryBasicAclProvider to walk the inheritance hierarchy. An
domain object instance need not have a parent.
getAclObjectParentIdentity in interface BasicAclEntrynull if no parent should be consulted)public abstract int[] getValidPermissions()
public static final int. It is further recommended that
valid combinations of permissions are also exposed as public
static final ints.
This method returns all permission integers that are allowed to be used together. This must include any combinations of valid permissions. So if the permissions indicated by 2^^2 (4) and 2^^1 (2) can be used together, one of the integers returned by this method must be 6 (4 + 2). Otherwise attempts to set the permission will be rejected, as the final resulting mask will be rejected.
Whilst it may seem unduly time onerous to return every valid permission combination, doing so delivers maximum flexibility in ensuring ACLs only reflect logical combinations. For example, it would be inappropriate to grant a "read" and "write" permission along with an "unrestricted" permission, as the latter implies the former permissions.
public abstract String printPermissionsBlock(int i)
i - the integer containing the mask which should be printed
public void setMask(int mask)
BasicAclEntry
setMask in interface BasicAclEntrymask - the integer representing the permissions bit maskpublic int getMask()
BasicAclEntry
getMask in interface BasicAclEntrypublic boolean isPermitted(int permissionToCheck)
BasicAclEntry
isPermitted in interface BasicAclEntrypublic void setRecipient(Object recipient)
BasicAclEntry
setRecipient in interface BasicAclEntryrecipient - a representation of the recipient of this ACL entry
that makes sense to an EffectiveAclsResolver
implementationpublic Object getRecipient()
BasicAclEntryBasicAclEntrys. Each separate BasicAclEntry
applies to a particular "recipient". Typical examples of recipients
include (but do not necessarily have to include) usernames, role names,
complex granted authorities etc.
It is essential that only one BasicAclEntry exists for a
given recipient. Otherwise conflicts as to the mask that should
apply to a given recipient will occur.
This method indicates which recipient this BasicAclEntry
applies to. The returned object type will vary depending on the type of
recipient. For instance, it might be a String containing a
username, or a GrantedAuthorityImpl containing a complex
granted authority that is being granted the permissions contained in
this access control entry. The EffectiveAclsResolver and BasicAclProvider.getAcls(Object, Authentication) can process the
different recipient types and return only those that apply to a
specified Authentication object.
getRecipient in interface BasicAclEntrynull)public int addPermission(int permissionToAdd)
public int addPermissions(int[] permissionsToAdd)
public int deletePermission(int permissionToDelete)
public int deletePermissions(int[] permissionsToDelete)
public String printPermissionsBlock()
AbstractBasicAclEntry's mask.
public String toString()
toString in class Objectpublic int togglePermission(int permissionToToggle)
protected boolean isPermitted(int maskToCheck,
int permissionToCheck)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||