public class AbstractPermissionNode extends Object implements PermissionNode
| Constructor and Description |
|---|
AbstractPermissionNode() |
| Modifier and Type | Method and Description |
|---|---|
void |
addDependencies(Permission permission,
Permission... dependencies)
Attach to the given
Permission instance a set of permissions which depends on it so that if the
permission is denied then all its dependencies must be denied as well. |
void |
addPermission(Permission permission,
String name)
Add a permission instance to the list
|
void |
addPermission(Permission permission,
String grantName,
String denyName)
Add a permission instance to the list
|
void |
collapse()
Collapse the node
|
void |
expand(LoadCallback callback)
Expand the node.
|
List<Permission> |
getDependencies(Permission permission)
Get the dependencies (if any) attached to a given permission instance.
|
int |
getLevel()
A number indicating at what specific levels this node is placed within the
PermissionTree |
String |
getNodeFullName()
Retrieves the full name to display for the given node.
|
String |
getNodeName()
Retrieves the name to display for the given node.
|
PermissionNode |
getParentNode()
Get the parent node.
|
String |
getPermissionDenyName(Permission permission)
Retrieves the name to display for the deny action.
|
String |
getPermissionGrantName(Permission permission)
Retrieves the name to display for the grant action.
|
List<Permission> |
getPermissionList()
The list of permissions attached to this node.
|
PermissionTree |
getPermissionTree()
Get the
PermissionTree instance this root node has been attached to. |
PermissionTreeProvider |
getPermissionTreeProvider()
Get the provider instance that built this node instance.
|
int |
getPositionInTree()
The position of the node within the permission tree.
|
Object |
getProperty(String key)
Get a property attached to this node
|
boolean |
impliesName(Permission other) |
List<Permission> |
impliesName(PermissionNode node)
Retrieve the permissions of the specified node that are implied by this node's permissions.
|
boolean |
isExpanded()
Get the expand status
|
boolean |
propertyEquals(String key,
Object value)
Check if a property exists and matchs the given value
|
void |
setNodeFullName(String nodeFullName) |
void |
setNodeName(String nodeName) |
void |
setParentNode(PermissionNode parentNode)
Set this node's parent
|
void |
setPermissionDenyName(Permission permission,
String name) |
void |
setPermissionGrantName(Permission permission,
String name) |
void |
setPermissionTree(PermissionTree permissionTree)
Attach this root node to the given
PermissionTree instance. |
void |
setPermissionTreeProvider(PermissionTreeProvider permissionTreeProvider)
Set the provider instance that built this node instance.
|
void |
setPositionInTree(int positionInTree) |
void |
setProperty(String key,
Object value)
Attach a property to this node
|
void |
updatePermissionList(PermissionCollection permissions)
Updates the node's permission values according to the values specified in the given collection.
|
public PermissionTree getPermissionTree()
PermissionNodePermissionTree instance this root node has been attached to.getPermissionTree in interface PermissionNodepublic void setPermissionTree(PermissionTree permissionTree)
PermissionNodePermissionTree instance.setPermissionTree in interface PermissionNodepublic PermissionTreeProvider getPermissionTreeProvider()
PermissionNodegetPermissionTreeProvider in interface PermissionNodepublic void setPermissionTreeProvider(PermissionTreeProvider permissionTreeProvider)
PermissionNodesetPermissionTreeProvider in interface PermissionNodepublic PermissionNode getParentNode()
PermissionNodegetParentNode in interface PermissionNodepublic void setParentNode(PermissionNode parentNode)
PermissionNodesetParentNode in interface PermissionNodepublic List<Permission> getPermissionList()
PermissionNodegetPermissionList in interface PermissionNodepublic void addPermission(Permission permission, String name)
PermissionNodeaddPermission in interface PermissionNodepublic void addPermission(Permission permission, String grantName, String denyName)
PermissionNodeaddPermission in interface PermissionNodepublic boolean isExpanded()
PermissionNodeisExpanded in interface PermissionNodepublic Object getProperty(String key)
PermissionNodegetProperty in interface PermissionNodekey - The property keypublic void setProperty(String key, Object value)
PermissionNodesetProperty in interface PermissionNodekey - The property keyvalue - The value objectpublic boolean propertyEquals(String key, Object value)
PermissionNodepropertyEquals in interface PermissionNodekey - The property keyvalue - The value object to checkpublic int getPositionInTree()
PermissionNodePermissionTree
implementations to order its root nodes from lower position nodes to higher ones.getPositionInTree in interface PermissionNodepublic void setPositionInTree(int positionInTree)
public String getNodeName()
PermissionNodegetNodeName in interface PermissionNodepublic void setNodeName(String nodeName)
public String getNodeFullName()
PermissionNodegetNodeFullName in interface PermissionNodepublic void setNodeFullName(String nodeFullName)
public String getPermissionGrantName(Permission permission)
PermissionNodegetPermissionGrantName in interface PermissionNodepermission - The Permission instancepublic void setPermissionGrantName(Permission permission, String name)
public String getPermissionDenyName(Permission permission)
PermissionNodegetPermissionDenyName in interface PermissionNodepermission - The Permission instancepublic void setPermissionDenyName(Permission permission, String name)
public List<Permission> impliesName(PermissionNode node)
PermissionNodeimpliesName in interface PermissionNodePermission instancespublic boolean impliesName(Permission other)
public void updatePermissionList(PermissionCollection permissions)
PermissionNodeupdatePermissionList in interface PermissionNodepermissions - The permission collection with the results to apply.public void addDependencies(Permission permission, Permission... dependencies)
PermissionNodePermission instance a set of permissions which depends on it so that if the
permission is denied then all its dependencies must be denied as well.
For instance, the update and delete permission over a resource depends on the read permission.
addDependencies in interface PermissionNodepermission - The Permission instancedependencies - The set of dependenciespublic List<Permission> getDependencies(Permission permission)
PermissionNodegetDependencies in interface PermissionNodepermission - The permission to checkpublic int getLevel()
PermissionNodePermissionTreegetLevel in interface PermissionNodepublic void expand(LoadCallback callback)
PermissionNode
The children nodes are loaded asynchronously and the consumer instance passed as a parameter is invoked after the loading process is done.
It does nothing in case the node is already expanded.
expand in interface PermissionNodecallback - The callback instance that consumes the children nodes.public void collapse()
PermissionNodecollapse in interface PermissionNodeCopyright © 2012–2018 JBoss by Red Hat. All rights reserved.