Class ACLEntryImpl
- java.lang.Object
-
- org.jboss.security.acl.ACLEntryImpl
-
- All Implemented Interfaces:
Serializable
,ACLEntry
@Entity public class ACLEntryImpl extends Object implements ACLEntry, Serializable
This class represents an entry in the Access Control List (ACL), and associates a permission to an identity. This implementation only stores permissions of type
BitMaskPermission
, and can also only check permissions of that type.- Author:
- Stefan Guilhen
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ACLEntryImpl(BitMaskPermission permission, String identityOrRole)
Builds an instance ofACLEntryImpl
with the specified permission and identity/role name.ACLEntryImpl(BitMaskPermission permission, Identity identity)
Builds an instance ofACLEntryImpl
with the specified permission and identity.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkPermission(ACLPermission permission)
Checks if the specified permission is part of the this entry's permission.boolean
equals(Object obj)
ACLImpl
getAcl()
long
getACLEntryId()
Obtains the persistent id of thisACLEntryImpl
.Identity
getIdentity()
Obtains theIdentity
for which a permission has been assigned in this entry.String
getIdentityOrRole()
Obtains the identity or role for which a permission has been assigned in this entry.ACLPermission
getPermission()
Obtains thePermission
object held by this entry.int
hashCode()
void
setAcl(ACLImpl acl)
-
-
-
Constructor Detail
-
ACLEntryImpl
public ACLEntryImpl(BitMaskPermission permission, Identity identity)
Builds an instance of
ACLEntryImpl
with the specified permission and identity.- Parameters:
permission
- theACLPermission
granted to the associated identity.identity
- theIdentity
for which the permission is being granted.
-
ACLEntryImpl
public ACLEntryImpl(BitMaskPermission permission, String identityOrRole)
Builds an instance of
ACLEntryImpl
with the specified permission and identity/role name.- Parameters:
permission
- theACLPermission
granted to the associated identity.identityOrRole
- aString
representing the identity or role name.
-
-
Method Detail
-
getACLEntryId
public long getACLEntryId()
Obtains the persistent id of this
ACLEntryImpl
.- Returns:
- a
long
representing the persistent id this entry.
-
getAcl
public ACLImpl getAcl()
-
setAcl
public void setAcl(ACLImpl acl)
-
getIdentityOrRole
public String getIdentityOrRole()
Description copied from interface:ACLEntry
Obtains the identity or role for which a permission has been assigned in this entry.
- Specified by:
getIdentityOrRole
in interfaceACLEntry
- Returns:
- a
String
representing the identity or role name.
-
getIdentity
public Identity getIdentity()
Description copied from interface:ACLEntry
Obtains the
Identity
for which a permission has been assigned in this entry.- Specified by:
getIdentity
in interfaceACLEntry
- Returns:
- a reference to the
Identity
contained in this entry.
-
getPermission
public ACLPermission getPermission()
Description copied from interface:ACLEntry
Obtains the
Permission
object held by this entry.- Specified by:
getPermission
in interfaceACLEntry
- Returns:
- a reference to the
Permission
contained in this entry.
-
checkPermission
public boolean checkPermission(ACLPermission permission)
Description copied from interface:ACLEntry
Checks if the specified permission is part of the this entry's permission.
- Specified by:
checkPermission
in interfaceACLEntry
- Parameters:
permission
- theACLPermission
to be checked for.- Returns:
true
if the permission is part of this entry's permission;false
otherwise.
-
-