Interface PermissionNode
-
- All Known Implementing Classes:
AbstractPermissionNode,PermissionGroupNode,PermissionLeafNode,PermissionResourceNode
public interface PermissionNodeA permission tree node
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddDependencies(org.uberfire.security.authz.Permission permission, org.uberfire.security.authz.Permission... dependencies)Attach to the givenPermissioninstance a set of permissions which depends on it so that if the permission is denied then all its dependencies must be denied as well.voidaddPermission(org.uberfire.security.authz.Permission permission, String name)Add a permission instance to the listvoidaddPermission(org.uberfire.security.authz.Permission permission, String grantName, String denyName)Add a permission instance to the listvoidcollapse()Collapse the nodevoidexpand(LoadCallback consumer)Expand the node.List<org.uberfire.security.authz.Permission>getDependencies(org.uberfire.security.authz.Permission permission)Get the dependencies (if any) attached to a given permission instance.intgetLevel()A number indicating at what specific levels this node is placed within thePermissionTreeStringgetNodeFullName()Retrieves the full name to display for the given node.StringgetNodeName()Retrieves the name to display for the given node.PermissionNodegetParentNode()Get the parent node.StringgetPermissionDenyName(org.uberfire.security.authz.Permission permission)Retrieves the name to display for the deny action.StringgetPermissionGrantName(org.uberfire.security.authz.Permission permission)Retrieves the name to display for the grant action.List<org.uberfire.security.authz.Permission>getPermissionList()The list of permissions attached to this node.PermissionTreegetPermissionTree()Get thePermissionTreeinstance this root node has been attached to.PermissionTreeProvidergetPermissionTreeProvider()Get the provider instance that built this node instance.intgetPositionInTree()The position of the node within the permission tree.ObjectgetProperty(String key)Get a property attached to this nodeList<org.uberfire.security.authz.Permission>impliesName(PermissionNode node)Retrieve the permissions of the specified node that are implied by this node's permissions.booleanisExpanded()Get the expand statusbooleanpropertyEquals(String key, Object value)Check if a property exists and matchs the given valuevoidsetParentNode(PermissionNode parentNode)Set this node's parentvoidsetPermissionTree(PermissionTree tree)Attach this root node to the givenPermissionTreeinstance.voidsetPermissionTreeProvider(PermissionTreeProvider provider)Set the provider instance that built this node instance.voidsetProperty(String key, Object value)Attach a property to this nodevoidupdatePermissionList(org.uberfire.security.authz.PermissionCollection collection)Updates the node's permission values according to the values specified in the given collection.
-
-
-
Method Detail
-
getPermissionTreeProvider
PermissionTreeProvider getPermissionTreeProvider()
Get the provider instance that built this node instance.
-
setPermissionTreeProvider
void setPermissionTreeProvider(PermissionTreeProvider provider)
Set the provider instance that built this node instance.
-
getPermissionTree
PermissionTree getPermissionTree()
Get thePermissionTreeinstance this root node has been attached to.
-
setPermissionTree
void setPermissionTree(PermissionTree tree)
Attach this root node to the givenPermissionTreeinstance.
-
getParentNode
PermissionNode getParentNode()
Get the parent node.- Returns:
- null if this is a root node
-
setParentNode
void setParentNode(PermissionNode parentNode)
Set this node's parent
-
getLevel
int getLevel()
A number indicating at what specific levels this node is placed within thePermissionTree- Returns:
- A positive integer from 0 to N, where 0=root, N=leaf.
-
getNodeName
String getNodeName()
Retrieves the name to display for the given node.- Returns:
- The name to display in the UI
-
getNodeFullName
String getNodeFullName()
Retrieves the full name to display for the given node.- Returns:
- The name to display in the UI
-
getPositionInTree
int getPositionInTree()
The position of the node within the permission tree. The position is used byPermissionTreeimplementations to order its root nodes from lower position nodes to higher ones.
-
getPermissionList
List<org.uberfire.security.authz.Permission> getPermissionList()
The list of permissions attached to this node.
-
updatePermissionList
void updatePermissionList(org.uberfire.security.authz.PermissionCollection collection)
Updates the node's permission values according to the values specified in the given collection.- Parameters:
collection- The permission collection with the results to apply.
-
addPermission
void addPermission(org.uberfire.security.authz.Permission permission, String name)Add a permission instance to the list
-
addPermission
void addPermission(org.uberfire.security.authz.Permission permission, String grantName, String denyName)Add a permission instance to the list
-
getPermissionGrantName
String getPermissionGrantName(org.uberfire.security.authz.Permission permission)
Retrieves the name to display for the grant action.- Parameters:
permission- ThePermissioninstance- Returns:
- The name to display in the UI
-
getPermissionDenyName
String getPermissionDenyName(org.uberfire.security.authz.Permission permission)
Retrieves the name to display for the deny action.- Parameters:
permission- ThePermissioninstance- Returns:
- The name to display in the UI
-
addDependencies
void addDependencies(org.uberfire.security.authz.Permission permission, org.uberfire.security.authz.Permission... dependencies)Attach to the givenPermissioninstance 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.
- Parameters:
permission- ThePermissioninstancedependencies- The set of dependencies
-
getDependencies
List<org.uberfire.security.authz.Permission> getDependencies(org.uberfire.security.authz.Permission permission)
Get the dependencies (if any) attached to a given permission instance.- Parameters:
permission- The permission to check- Returns:
- A list of permissions
-
isExpanded
boolean isExpanded()
Get the expand status- Returns:
- true if expanded, false if collapsed
-
getProperty
Object getProperty(String key)
Get a property attached to this node- Parameters:
key- The property key- Returns:
- The value object
-
setProperty
void setProperty(String key, Object value)
Attach a property to this node- Parameters:
key- The property keyvalue- The value object
-
propertyEquals
boolean propertyEquals(String key, Object value)
Check if a property exists and matchs the given value- Parameters:
key- The property keyvalue- The value object to check
-
impliesName
List<org.uberfire.security.authz.Permission> impliesName(PermissionNode node)
Retrieve the permissions of the specified node that are implied by this node's permissions.- Returns:
- A sub-list of
Permissioninstances
-
expand
void expand(LoadCallback consumer)
Expand the node.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.
- Parameters:
consumer- The callback instance that consumes the children nodes.
-
collapse
void collapse()
Collapse the node
-
-