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()
PermissionNode
PermissionTree
instance this root node has been attached to.getPermissionTree
in interface PermissionNode
public void setPermissionTree(PermissionTree permissionTree)
PermissionNode
PermissionTree
instance.setPermissionTree
in interface PermissionNode
public PermissionTreeProvider getPermissionTreeProvider()
PermissionNode
getPermissionTreeProvider
in interface PermissionNode
public void setPermissionTreeProvider(PermissionTreeProvider permissionTreeProvider)
PermissionNode
setPermissionTreeProvider
in interface PermissionNode
public PermissionNode getParentNode()
PermissionNode
getParentNode
in interface PermissionNode
public void setParentNode(PermissionNode parentNode)
PermissionNode
setParentNode
in interface PermissionNode
public List<Permission> getPermissionList()
PermissionNode
getPermissionList
in interface PermissionNode
public void addPermission(Permission permission, String name)
PermissionNode
addPermission
in interface PermissionNode
public void addPermission(Permission permission, String grantName, String denyName)
PermissionNode
addPermission
in interface PermissionNode
public boolean isExpanded()
PermissionNode
isExpanded
in interface PermissionNode
public Object getProperty(String key)
PermissionNode
getProperty
in interface PermissionNode
key
- The property keypublic void setProperty(String key, Object value)
PermissionNode
setProperty
in interface PermissionNode
key
- The property keyvalue
- The value objectpublic boolean propertyEquals(String key, Object value)
PermissionNode
propertyEquals
in interface PermissionNode
key
- The property keyvalue
- The value object to checkpublic int getPositionInTree()
PermissionNode
PermissionTree
implementations to order its root nodes from lower position nodes to higher ones.getPositionInTree
in interface PermissionNode
public void setPositionInTree(int positionInTree)
public String getNodeName()
PermissionNode
getNodeName
in interface PermissionNode
public void setNodeName(String nodeName)
public String getNodeFullName()
PermissionNode
getNodeFullName
in interface PermissionNode
public void setNodeFullName(String nodeFullName)
public String getPermissionGrantName(Permission permission)
PermissionNode
getPermissionGrantName
in interface PermissionNode
permission
- The Permission
instancepublic void setPermissionGrantName(Permission permission, String name)
public String getPermissionDenyName(Permission permission)
PermissionNode
getPermissionDenyName
in interface PermissionNode
permission
- The Permission
instancepublic void setPermissionDenyName(Permission permission, String name)
public List<Permission> impliesName(PermissionNode node)
PermissionNode
impliesName
in interface PermissionNode
Permission
instancespublic boolean impliesName(Permission other)
public void updatePermissionList(PermissionCollection permissions)
PermissionNode
updatePermissionList
in interface PermissionNode
permissions
- The permission collection with the results to apply.public void addDependencies(Permission permission, Permission... dependencies)
PermissionNode
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.
For instance, the update and delete permission over a resource depends on the read permission.
addDependencies
in interface PermissionNode
permission
- The Permission
instancedependencies
- The set of dependenciespublic List<Permission> getDependencies(Permission permission)
PermissionNode
getDependencies
in interface PermissionNode
permission
- The permission to checkpublic int getLevel()
PermissionNode
PermissionTree
getLevel
in interface PermissionNode
public 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 PermissionNode
callback
- The callback instance that consumes the children nodes.public void collapse()
PermissionNode
collapse
in interface PermissionNode
Copyright © 2012–2019 JBoss by Red Hat. All rights reserved.