Interface RolesHolder

    • Method Detail

      • getRolesWithScope

        @NotNull
        Collection<Role> getRolesWithScope​(@NotNull
                                           RoleScope scope)
        Returns all roles with specified scope.
        Parameters:
        scope - roles scope
        Returns:
        all roles with specified scope.
      • getScopes

        Collection<RoleScope> getScopes()
        Returns all scopes with assigned roles
        Returns:
        all scopes with assigned roles
      • getRoles

        @NotNull
        Collection<RoleEntry> getRoles()
        Returns roles with their scopes
        Returns:
        roles with their scopes
      • addRole

        void addRole​(@NotNull
                     RoleScope scope,
                     @NotNull
                     Role role)
        Adds role with specified scope
        Parameters:
        scope - scope of the role
        role - role
      • removeRole

        void removeRole​(@NotNull
                        RoleScope scope,
                        @NotNull
                        Role role)
        Removes role with specified scope
        Parameters:
        scope - scope of the role
        role - role
      • removeRole

        void removeRole​(@NotNull
                        Role role)
        Removes specified role. If the role is associated with several scopes all of these roles will be removed.
        Parameters:
        role - role to remove
      • removeRoles

        void removeRoles​(@NotNull
                         RoleScope scope)
        Removes all of the roles having the specified scope.
        Parameters:
        scope - scope of the role
      • isSystemAdministratorRoleGranted

        boolean isSystemAdministratorRoleGranted()
        Returns true if this roles holder contains system administrator role granted directly or inherited via parent holders. Same as:
        isSystemAdministratorRoleGrantedDirectly() || isSystemAdministratorRoleInherited()
        Returns:
        see above.
      • isSystemAdministratorRoleGrantedDirectly

        boolean isSystemAdministratorRoleGrantedDirectly()
        Returns true if this roles holder contains system administrator role granted directly.
        Returns:
        see above.
      • isSystemAdministratorRoleInherited

        boolean isSystemAdministratorRoleInherited()
        Returns true if one of the parents (transitively) of this roles holder contains system administrator role.
        Returns:
        see above
      • getParentHolders

        @NotNull
        Collection<RolesHolder> getParentHolders()
        Returns direct (non transitive) parent holders.
        Returns:
        parent holders
      • getAllParentHolders

        @NotNull
        Collection<RolesHolder> getAllParentHolders()
        Returns all parent holders including transitive ones
        Returns:
        all parent holders