Interface PermissionNode

    • 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.
      • 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 the PermissionTree
        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 by PermissionTree implementations 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 - The Permission instance
        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 - The Permission instance
        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 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.

        Parameters:
        permission - The Permission instance
        dependencies - 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 key
        value - The value object
      • propertyEquals

        boolean propertyEquals​(String key,
                               Object value)
        Check if a property exists and matchs the given value
        Parameters:
        key - The property key
        value - 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 Permission instances
      • 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