public abstract class AbstractAccessControlProvider extends Object implements AccessControlProvider
AccessControlProvider
.initialize(AccessControlSchema)
from the derived implementation.Modifier and Type | Field and Description |
---|---|
private Map<String,AccessControl> |
id2nodeMap |
private static org.slf4j.Logger |
LOG
Logger instance.
|
Constructor and Description |
---|
AbstractAccessControlProvider()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkForCyclicDependencies(AccessControlGroup group,
Set<AccessControlGroup> visitedGroups)
Checks that the given
AccessControlGroup has no cyclic inheritance
graph . |
boolean |
collectAccessControlIds(String groupId,
Set<String> permissions)
This method collects the
IDs of all AccessControlPermission s (or more
precisely of all AccessControl s) contained in the AccessControl identified by the given groupId . |
protected void |
collectAccessControls(AccessControlGroup group,
Set<AccessControlGroup> toplevelGroups)
Called from
initialize(AccessControlSchema) to collect all AccessControl s recursively. |
boolean |
collectAccessControls(String groupId,
Set<AccessControl> permissions)
This method collects the
AccessControl s contained in the AccessControl
identified by the given groupId . |
void |
collectPermissionIds(AccessControlGroup group,
Set<String> permissions)
Recursive implementation of
collectAccessControlIds(String, Set) for AccessControlGroup s. |
void |
collectPermissionNodes(AccessControlGroup group,
Set<AccessControl> permissions)
Recursive implementation of
collectAccessControls(String, Set) for AccessControlGroup s. |
AccessControl |
getAccessControl(String nodeId) |
protected void |
initialize(AccessControlSchema config)
Performs the required initialization of this class.
|
private static final org.slf4j.Logger LOG
private final Map<String,AccessControl> id2nodeMap
getAccessControl(String)
public AbstractAccessControlProvider()
protected void initialize(AccessControlSchema config)
config
- is the AccessControlSchema
.protected void checkForCyclicDependencies(AccessControlGroup group, Set<AccessControlGroup> visitedGroups)
AccessControlGroup
has no cyclic inheritance
graph
.group
- is the AccessControlGroup
to check.visitedGroups
- is where the AccessControlGroup
are collected to detect cycles.protected void collectAccessControls(AccessControlGroup group, Set<AccessControlGroup> toplevelGroups)
initialize(AccessControlSchema)
to collect all AccessControl
s recursively.group
- the AccessControlGroup
to traverse.toplevelGroups
- is the Set
of all AccessControlGroup
s from
AccessControlSchema.getGroups()
.public AccessControl getAccessControl(String nodeId)
getAccessControl
in interface AccessControlProvider
nodeId
- is the ID
of the requested AccessControl
.AccessControl
or null
if not found.public boolean collectAccessControlIds(String groupId, Set<String> permissions)
AccessControlProvider
IDs
of all AccessControlPermission
s (or more
precisely of all AccessControl
s) contained in the AccessControl
identified
by the given groupId
.collectAccessControlIds
in interface AccessControlProvider
groupId
- is the ID
of the AccessControl
(typically an
AccessControlGroup
) to collect.permissions
- is the Set
where to add
the collected
IDs
. This will include the given groupId
.true
if the given groupId
has been found, false
otherwise.AccessControlProvider.collectAccessControls(String, Set)
public void collectPermissionIds(AccessControlGroup group, Set<String> permissions)
collectAccessControlIds(String, Set)
for AccessControlGroup
s.group
- is the AccessControlGroup
to traverse.permissions
- is the Set
used to collect.public boolean collectAccessControls(String groupId, Set<AccessControl> permissions)
AccessControlProvider
AccessControl
s contained in the AccessControl
identified
by the given groupId
.collectAccessControls
in interface AccessControlProvider
groupId
- is the ID
of the AccessControl
(typically an
AccessControlGroup
) to collect.permissions
- is the Set
where to add
the collected AccessControl
s.
This will include the AccessControl
identified
by the given
groupId
.true
if the given groupId
has been found, false
otherwise.public void collectPermissionNodes(AccessControlGroup group, Set<AccessControl> permissions)
collectAccessControls(String, Set)
for AccessControlGroup
s.group
- is the AccessControlGroup
to traverse.permissions
- is the Set
used to collect.Copyright © 2014–2016 OASP-Team. All rights reserved.