Class UserRole


  • public class UserRole
    extends Object
    • Constructor Detail

      • UserRole

        public UserRole​(String name)
      • UserRole

        public UserRole()
    • Method Detail

      • getId

        public String getId()
      • getName

        public String getName()
        The name for this role. This has no purpose other than labeling, and is not guaranteed to be unique.
      • isArchived

        public boolean isArchived()
        This entity is soft-deleted instead of hard-deleted, and this field is set to true when the entity is soft-deleted.
      • getLastUpdated

        public Instant getLastUpdated()
        Indicates when this record was last updated.
      • getPermissions

        public Set<UserPermissionRef> getPermissions()
        The permissions that this role has been directly assigned. The role inherits other permissions from its ancestors as described for parentRoleId.
      • getParentRoleId

        @Nullable
        public String getParentRoleId()
        The id of the parent of this role (if any).

        This role will effectively inherit all of the permissions of its parent and any ancestors further up in the hierarchy.

        In standard CRUD operations, there is validation in place to prevent cycles from being created in a role's ancestry (role cannot become a parent of itself). However, as roles may be modified by persistence messages, there may temporarily be broken references or cycles in this hierarchy. To guard against trouble when fetching a role's ancestry, use UserRoleAncestryHydrationService.

        See Also:
        UserRoleValidator, UserRoleAncestryHydrationService, AdminRolePersistenceHandler
      • setId

        public void setId​(String id)
      • setName

        public void setName​(String name)
        The name for this role. This has no purpose other than labeling, and is not guaranteed to be unique.
      • setArchived

        public void setArchived​(boolean archived)
        This entity is soft-deleted instead of hard-deleted, and this field is set to true when the entity is soft-deleted.
      • setLastUpdated

        public void setLastUpdated​(Instant lastUpdated)
        Indicates when this record was last updated.
      • setPermissions

        public void setPermissions​(Set<UserPermissionRef> permissions)
        The permissions that this role has been directly assigned. The role inherits other permissions from its ancestors as described for parentRoleId.
      • setParentRoleId

        public void setParentRoleId​(@Nullable
                                    String parentRoleId)
        The id of the parent of this role (if any).

        This role will effectively inherit all of the permissions of its parent and any ancestors further up in the hierarchy.

        In standard CRUD operations, there is validation in place to prevent cycles from being created in a role's ancestry (role cannot become a parent of itself). However, as roles may be modified by persistence messages, there may temporarily be broken references or cycles in this hierarchy. To guard against trouble when fetching a role's ancestry, use UserRoleAncestryHydrationService.

        See Also:
        UserRoleValidator, UserRoleAncestryHydrationService, AdminRolePersistenceHandler
      • canEqual

        protected boolean canEqual​(Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object