Class AbstractPermissionNode

    • Constructor Detail

      • AbstractPermissionNode

        public AbstractPermissionNode()
    • Method Detail

      • getPermissionList

        public List<org.uberfire.security.authz.Permission> getPermissionList()
        Description copied from interface: PermissionNode
        The list of permissions attached to this node.
        Specified by:
        getPermissionList in interface PermissionNode
      • addPermission

        public void addPermission​(org.uberfire.security.authz.Permission permission,
                                  String name)
        Description copied from interface: PermissionNode
        Add a permission instance to the list
        Specified by:
        addPermission in interface PermissionNode
      • addPermission

        public void addPermission​(org.uberfire.security.authz.Permission permission,
                                  String grantName,
                                  String denyName)
        Description copied from interface: PermissionNode
        Add a permission instance to the list
        Specified by:
        addPermission in interface PermissionNode
      • isExpanded

        public boolean isExpanded()
        Description copied from interface: PermissionNode
        Get the expand status
        Specified by:
        isExpanded in interface PermissionNode
        Returns:
        true if expanded, false if collapsed
      • getProperty

        public Object getProperty​(String key)
        Description copied from interface: PermissionNode
        Get a property attached to this node
        Specified by:
        getProperty in interface PermissionNode
        Parameters:
        key - The property key
        Returns:
        The value object
      • setProperty

        public void setProperty​(String key,
                                Object value)
        Description copied from interface: PermissionNode
        Attach a property to this node
        Specified by:
        setProperty in interface PermissionNode
        Parameters:
        key - The property key
        value - The value object
      • propertyEquals

        public boolean propertyEquals​(String key,
                                      Object value)
        Description copied from interface: PermissionNode
        Check if a property exists and matchs the given value
        Specified by:
        propertyEquals in interface PermissionNode
        Parameters:
        key - The property key
        value - The value object to check
      • getPositionInTree

        public int getPositionInTree()
        Description copied from interface: PermissionNode
        The position of the node within the permission tree. The position is used by PermissionTree implementations to order its root nodes from lower position nodes to higher ones.
        Specified by:
        getPositionInTree in interface PermissionNode
      • setPositionInTree

        public void setPositionInTree​(int positionInTree)
      • getNodeName

        public String getNodeName()
        Description copied from interface: PermissionNode
        Retrieves the name to display for the given node.
        Specified by:
        getNodeName in interface PermissionNode
        Returns:
        The name to display in the UI
      • setNodeName

        public void setNodeName​(String nodeName)
      • getNodeFullName

        public String getNodeFullName()
        Description copied from interface: PermissionNode
        Retrieves the full name to display for the given node.
        Specified by:
        getNodeFullName in interface PermissionNode
        Returns:
        The name to display in the UI
      • setNodeFullName

        public void setNodeFullName​(String nodeFullName)
      • getPermissionGrantName

        public String getPermissionGrantName​(org.uberfire.security.authz.Permission permission)
        Description copied from interface: PermissionNode
        Retrieves the name to display for the grant action.
        Specified by:
        getPermissionGrantName in interface PermissionNode
        Parameters:
        permission - The Permission instance
        Returns:
        The name to display in the UI
      • setPermissionGrantName

        public void setPermissionGrantName​(org.uberfire.security.authz.Permission permission,
                                           String name)
      • getPermissionDenyName

        public String getPermissionDenyName​(org.uberfire.security.authz.Permission permission)
        Description copied from interface: PermissionNode
        Retrieves the name to display for the deny action.
        Specified by:
        getPermissionDenyName in interface PermissionNode
        Parameters:
        permission - The Permission instance
        Returns:
        The name to display in the UI
      • setPermissionDenyName

        public void setPermissionDenyName​(org.uberfire.security.authz.Permission permission,
                                          String name)
      • impliesName

        public List<org.uberfire.security.authz.Permission> impliesName​(PermissionNode node)
        Description copied from interface: PermissionNode
        Retrieve the permissions of the specified node that are implied by this node's permissions.
        Specified by:
        impliesName in interface PermissionNode
        Returns:
        A sub-list of Permission instances
      • impliesName

        public boolean impliesName​(org.uberfire.security.authz.Permission other)
      • updatePermissionList

        public void updatePermissionList​(org.uberfire.security.authz.PermissionCollection permissions)
        Description copied from interface: PermissionNode
        Updates the node's permission values according to the values specified in the given collection.
        Specified by:
        updatePermissionList in interface PermissionNode
        Parameters:
        permissions - The permission collection with the results to apply.
      • addDependencies

        public void addDependencies​(org.uberfire.security.authz.Permission permission,
                                    org.uberfire.security.authz.Permission... dependencies)
        Description copied from interface: PermissionNode
        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.

        For instance, the update and delete permission over a resource depends on the read permission.

        Specified by:
        addDependencies in interface PermissionNode
        Parameters:
        permission - The Permission instance
        dependencies - The set of dependencies
      • getDependencies

        public List<org.uberfire.security.authz.Permission> getDependencies​(org.uberfire.security.authz.Permission permission)
        Description copied from interface: PermissionNode
        Get the dependencies (if any) attached to a given permission instance.
        Specified by:
        getDependencies in interface PermissionNode
        Parameters:
        permission - The permission to check
        Returns:
        A list of permissions
      • getLevel

        public int getLevel()
        Description copied from interface: PermissionNode
        A number indicating at what specific levels this node is placed within the PermissionTree
        Specified by:
        getLevel in interface PermissionNode
        Returns:
        A positive integer from 0 to N, where 0=root, N=leaf.
      • expand

        public void expand​(LoadCallback callback)
        Description copied from interface: PermissionNode
        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.

        Specified by:
        expand in interface PermissionNode
        Parameters:
        callback - The callback instance that consumes the children nodes.