Class RoleImpl

    • Method Detail

      • getOrderNum

        public int getOrderNum()
      • disableProjectAssociation

        public void disableProjectAssociation()
        By default we compute whether a role can be associated to a particular project by permissions containing in the role. If role contains at least one project permission Permission.isProjectAssociationSupported() returns true, we consider that this role can be associated with a project. But sometimes it is needed to override this behaviour and disable project association for some roles even if they contain project permissions (for example, Sysadmin role).
      • isProjectAssociationDisabled

        public boolean isProjectAssociationDisabled()
      • getId

        @NotNull
        public String getId()
        Returns unique identifier of this role
        Specified by:
        getId in interface Role
        Returns:
        id of the role
      • getName

        @NotNull
        public String getName()
        Returns name of this role
        Specified by:
        getName in interface Role
        Returns:
        name of the role
      • getPermissions

        @NotNull
        public Permissions getPermissions()
        Returns permissions associated with this role
        Specified by:
        getPermissions in interface Role
        Returns:
        role permissions
      • getOwnPermissions

        @NotNull
        public Permissions getOwnPermissions()
        Description copied from interface: Role
        Return only own permissions of the role without inherited permissions
        Specified by:
        getOwnPermissions in interface Role
        Returns:
        own permissions of the role
      • getDisabledOwnPermissions

        @NotNull
        public Permissions getDisabledOwnPermissions()
      • getIncludedRoles

        @NotNull
        public Role[] getIncludedRoles()
        Description copied from interface: Role
        Returns roles which are included in this role
        Specified by:
        getIncludedRoles in interface Role
        Returns:
        included roles
      • isProjectAssociationSupported

        public boolean isProjectAssociationSupported()
        Description copied from interface: Role
        Returns true if this role can be associated with a particular project. This means that this role contains at least one permission that can be associated with a project.
        Specified by:
        isProjectAssociationSupported in interface Role
        Returns:
        true if this role can be associated with a project
      • addPermissions

        public void addPermissions​(@NotNull
                                   Permission... permissions)
        Description copied from interface: Role
        Adds permissions to the role
        Specified by:
        addPermissions in interface Role
        Parameters:
        permissions - permissions
      • removePermission

        public void removePermission​(@NotNull
                                     Permission permission)
        Description copied from interface: Role
        Removes permission from the role
        Specified by:
        removePermission in interface Role
        Parameters:
        permission - permission
      • addIncludedRole

        public void addIncludedRole​(@NotNull
                                    Role includedRole)
        Description copied from interface: Role
        Includes includedRole to the role
        Specified by:
        addIncludedRole in interface Role
        Parameters:
        includedRole - role to include
      • removeIncludedRole

        public void removeIncludedRole​(@NotNull
                                       Role includedRole)
        Description copied from interface: Role
        Excludes includedRole from the role
        Specified by:
        removeIncludedRole in interface Role
        Parameters:
        includedRole - role to include
      • doAddPermissions

        public void doAddPermissions​(Permissions permissions)
        Adds permissions to the role
        Parameters:
        permissions - adds permissions
      • doAddDisabledPermissions

        public void doAddDisabledPermissions​(Permissions permissions)
      • doRemovePermission

        public void doRemovePermission​(@NotNull
                                       Permission permission)
      • doAddIncludedRole

        public void doAddIncludedRole​(@NotNull
                                      Role role)
      • doRemoveIncludedRole

        public void doRemoveIncludedRole​(@NotNull
                                         Role role)
      • computeAllPermissions

        public void computeAllPermissions()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • describe

        @NotNull
        public String describe​(boolean verbose)
        Specified by:
        describe in interface Loggable
        Parameters:
        verbose - verbosity of object description
        Returns:
        description of this object. If verbose is true, description should have mode details.