Class DefaultAuthorizationPolicy

    • Constructor Detail

      • DefaultAuthorizationPolicy

        public DefaultAuthorizationPolicy()
    • Method Detail

      • getRoles

        public Set<org.jboss.errai.security.shared.api.Role> getRoles()
        Description copied from interface: AuthorizationPolicy
        Get the collection of roles this policy is related to.
        Specified by:
        getRoles in interface AuthorizationPolicy
      • getGroups

        public Set<org.jboss.errai.security.shared.api.Group> getGroups()
        Description copied from interface: AuthorizationPolicy
        Get the collection of groups this policy is related to.
        Specified by:
        getGroups in interface AuthorizationPolicy
      • getRoleDescription

        public String getRoleDescription​(org.jboss.errai.security.shared.api.Role role)
        Description copied from interface: AuthorizationPolicy
        Get the description of an existing role.
        Specified by:
        getRoleDescription in interface AuthorizationPolicy
        Parameters:
        role - The role
        Returns:
        The role description
      • setRoleDescription

        public void setRoleDescription​(org.jboss.errai.security.shared.api.Role role,
                                       String description)
        Description copied from interface: AuthorizationPolicy
        Sets a description for an existing role.
        Specified by:
        setRoleDescription in interface AuthorizationPolicy
        Parameters:
        role - The role
        description - A non empty description
      • getGroupDescription

        public String getGroupDescription​(org.jboss.errai.security.shared.api.Group group)
        Description copied from interface: AuthorizationPolicy
        Get the description of an existing group.
        Specified by:
        getGroupDescription in interface AuthorizationPolicy
        Parameters:
        group - The group
        Returns:
        The group description
      • setGroupDescription

        public void setGroupDescription​(org.jboss.errai.security.shared.api.Group group,
                                        String description)
        Description copied from interface: AuthorizationPolicy
        Sets a description for an existing group.
        Specified by:
        setGroupDescription in interface AuthorizationPolicy
        Parameters:
        group - The group identifier
        description - A non empty description
      • getPriority

        public int getPriority​(org.jboss.errai.security.shared.api.Role role)
        Description copied from interface: AuthorizationPolicy
        Get a role's priority. The priority is important during permission resolution and when a user is assigned to more than one role/group it is used to determine what is the most priority.
        Specified by:
        getPriority in interface AuthorizationPolicy
        Parameters:
        role - The role instance
        Returns:
        An integer. The highest, the more priority the collection is. Default priority value is 0.
      • getPriority

        public int getPriority​(org.jboss.errai.security.shared.api.Group group)
        Description copied from interface: AuthorizationPolicy
        Get a group's priority. The priority is important during permission resolution and when a user is assigned to more than one role/group it is used to determine what is the most priority.
        Specified by:
        getPriority in interface AuthorizationPolicy
        Parameters:
        group - The group instance
        Returns:
        An integer. The highest, the more priority the collection is. Default priority value is 0.
      • setPriority

        public void setPriority​(org.jboss.errai.security.shared.api.Role role,
                                int priority)
        Description copied from interface: AuthorizationPolicy
        Set the role's priority
        Specified by:
        setPriority in interface AuthorizationPolicy
        Parameters:
        role - The role instance
        priority - Any valid integer. The highest, the more priority the role is.
      • setPriority

        public void setPriority​(org.jboss.errai.security.shared.api.Group group,
                                int priority)
        Description copied from interface: AuthorizationPolicy
        Set the group's priority
        Specified by:
        setPriority in interface AuthorizationPolicy
        Parameters:
        group - The group instance
        priority - Any valid integer. The highest, the more priority the role is.
      • getPermissions

        public PermissionCollection getPermissions​(org.jboss.errai.security.shared.api.Role role)
        Description copied from interface: AuthorizationPolicy
        Get the permissions assigned to a given role.
        Specified by:
        getPermissions in interface AuthorizationPolicy
        Parameters:
        role - The role instance
        Returns:
        The permission collection. Notice, the default permission collection is also included in the results.
      • getPermissions

        public PermissionCollection getPermissions​(org.jboss.errai.security.shared.api.Group group)
        Description copied from interface: AuthorizationPolicy
        Get the permissions assigned to a given group.
        Specified by:
        getPermissions in interface AuthorizationPolicy
        Parameters:
        group - The group instance
        Returns:
        The permission collection. Notice, the default permission collection is also included in the results.
      • addPermission

        public void addPermission​(Permission permission)
      • addPermission

        public void addPermission​(org.jboss.errai.security.shared.api.Role role,
                                  Permission permission)
      • addPermission

        public void addPermission​(org.jboss.errai.security.shared.api.Group group,
                                  Permission permission)
        Description copied from interface: AuthorizationPolicy
        Add a single permission entry for a group.
        Specified by:
        addPermission in interface AuthorizationPolicy
        Parameters:
        group - The group instance
        permission - A permission instance
      • setHomePerspective

        public void setHomePerspective​(org.jboss.errai.security.shared.api.Role role,
                                       String perspective)
        Description copied from interface: AuthorizationPolicy
        Set the identifier of the home perspective assigned to the given role.
        Specified by:
        setHomePerspective in interface AuthorizationPolicy
        Parameters:
        role - The target role instance
        perspective - An existing perspective identifier
      • setHomePerspective

        public void setHomePerspective​(org.jboss.errai.security.shared.api.Group group,
                                       String perspective)
        Description copied from interface: AuthorizationPolicy
        Set the identifier of the home perspective assigned to the given group.
        Specified by:
        setHomePerspective in interface AuthorizationPolicy
        Parameters:
        group - The target group instance
        perspective - An existing perspective identifier
      • getHomePerspective

        public String getHomePerspective​(org.jboss.errai.security.shared.api.Role role)
        Description copied from interface: AuthorizationPolicy
        Get the identifier of the home perspective assigned to the given group.
        Specified by:
        getHomePerspective in interface AuthorizationPolicy
        Returns:
        An existing perspective identifier
      • getHomePerspective

        public String getHomePerspective​(org.jboss.errai.security.shared.api.Group group)
        Description copied from interface: AuthorizationPolicy
        Get the identifier of the home perspective assigned to the given group.
        Specified by:
        getHomePerspective in interface AuthorizationPolicy
        Returns:
        An existing perspective identifier
      • getHomePerspective

        public String getHomePerspective()
        Description copied from interface: AuthorizationPolicy
        Gets the identifier of the default home perspective.

        This is the perspective that is returned for those roles/groups with no home perspective set.

        Specified by:
        getHomePerspective in interface AuthorizationPolicy
        Returns:
        An existing perspective identifier
      • setHomePerspective

        public void setHomePerspective​(String perspectiveId)
        Description copied from interface: AuthorizationPolicy
        Sets the identifier of the default home perspective.

        This is the perspective that is returned for those roles/groups with no gome perspective set.

        Specified by:
        setHomePerspective in interface AuthorizationPolicy
        Parameters:
        perspectiveId - An existing perspective identifier