@Entity public class ACLImpl extends Object implements ACL, Serializable
Simple ACL implementation that keeps the entries in a Map whose keys are the identities of the entries, to provide fast access.
Constructor and Description |
---|
ACLImpl(Resource resource)
Builds an instance of
ACLImpl for the specified resource. |
ACLImpl(Resource resource,
Collection<ACLEntry> entries)
Builds an instance of
ACLImpl for the specified resource, and initialize it with the specified entries. |
ACLImpl(String resourceString,
Collection<ACLEntry> entries) |
Modifier and Type | Method and Description |
---|---|
boolean |
addEntry(ACLEntry entry)
Adds an entry to this ACL.
|
long |
getACLId()
Obtains the persistent id of this
ACLImpl . |
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.
|
String |
getResourceAsString()
Obtains the stringfied representation of the resource associated with 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.
|
void |
setResource(Resource resource)
Sets the resource associated with this
ACL . |
public ACLImpl(Resource resource)
Builds an instance of ACLImpl
for the specified resource.
resource
- a reference to the Resource
associated with the ACL being constructed.public ACLImpl(Resource resource, Collection<ACLEntry> entries)
Builds an instance of ACLImpl
for the specified resource, and initialize it with the specified entries.
resource
- a reference to the Resource
associated with the ACL being constructed.entries
- a Collection
containing the ACL's initial entries.public ACLImpl(String resourceString, Collection<ACLEntry> entries)
public long getACLId()
Obtains the persistent id of this ACLImpl
.
long
representing the persistent id this ACL.public boolean addEntry(ACLEntry entry)
ACL
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.
public boolean removeEntry(ACLEntry entry)
ACL
Removes an entry from this ACL.
removeEntry
in interface ACL
entry
- the ACLEntry
to be removed.true
if the entry is removed; false
if the entry can't be found in the ACL.public Collection<? extends ACLEntry> getEntries()
ACL
Obtains the collection of all ACLEntries
in this ACL.
getEntries
in interface ACL
Collection
containing all entries in this ACL.public ACLEntry getEntry(Identity identity)
ACL
Obtains the entry that corresponds to the specified identity. Calling this method is the same as doing
getEntry(identity.getName())
.
public ACLEntry getEntry(String identityOrRole)
ACL
Obtains the entry that corresponds to the specified identity or role name.
public boolean isGranted(ACLPermission permission, Identity identity)
ACL
Verify if the given permission is assigned to the specified Identity
.
public String getResourceAsString()
Obtains the stringfied representation of the resource associated with this ACL
.
String
representation of the resource.public Resource getResource()
ACL
Obtains a reference to the resource being protected by this ACL.
getResource
in interface ACL
Resource
.public void setResource(Resource resource)
Sets the resource associated with this ACL
.
resource
- a reference to the Resource
associated with this ACL
.Copyright © 2019 JBoss by Red Hat. All rights reserved.