public interface ACL
This interface represents an Access Control List (ACL), a data structure used to protect access to resources. It is
composed of entries, where each entry is represented by the ALCEntry
class and represents the permissions
assigned to a given identity.
When a client attempts to perform an operation on a resource, the ACL associated to the resource is used to verify if
the client has enough permissions to perform that operation. In order to do that, the ACLEntry
corresponding
to the client's identity is retrieved and then the permission set contained in the entry is verified to decide if
access should be granted or not.
Modifier and Type | Method and Description |
---|---|
boolean |
addEntry(ACLEntry entry)
Adds an entry to this ACL.
|
Collection<? extends ACLEntry> |
getEntries()
Obtains the collection of all
ACLEntries in this ACL. |
ACLEntry |
getEntry(Identity identity)
Obtains the entry that corresponds to the specified identity.
|
ACLEntry |
getEntry(String identityOrRole)
Obtains the entry that corresponds to the specified identity or role name.
|
Resource |
getResource()
Obtains a reference to the resource being protected by this ACL.
|
boolean |
isGranted(ACLPermission permission,
Identity identity)
Verify if the given permission is assigned to the specified
Identity . |
boolean |
removeEntry(ACLEntry entry)
Removes an entry from this ACL.
|
boolean addEntry(ACLEntry entry)
Adds an entry to this ACL. If the ACL already has an ACLEntry
associated to the new entry's identity, then
the new entry will not be added.
entry
- the ACLEntry
to be added.true
if the entry was added; false
otherwise.boolean removeEntry(ACLEntry entry)
Removes an entry from this ACL.
entry
- the ACLEntry
to be removed.true
if the entry is removed; false
if the entry can't be found in the ACL.Collection<? extends ACLEntry> getEntries()
Obtains the collection of all ACLEntries
in this ACL.
Collection
containing all entries in this ACL.ACLEntry getEntry(Identity identity)
Obtains the entry that corresponds to the specified identity. Calling this method is the same as doing
getEntry(identity.getName())
.
identity
- a reference to the Identity
object.ACLEntry
that corresponds to the identity, or null
if no entry could be found.ACLEntry getEntry(String identityOrRole)
Obtains the entry that corresponds to the specified identity or role name.
identityOrRole
- a String
representing an identity or role.ACLEntry
that corresponds to the identity or role or null
if no entry could be found.Resource getResource()
Obtains a reference to the resource being protected by this ACL.
Resource
.boolean isGranted(ACLPermission permission, Identity identity)
Verify if the given permission is assigned to the specified Identity
.
permission
- the ACLPermission
to be checked for.identity
- the Identity
being verified.true
if the specified permission is assigned to the identity; false
otherwise.Copyright © 2017 JBoss by Red Hat. All rights reserved.