Class UserRole
- All Implemented Interfaces:
Serializable
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanThe description of this role for display purposes.getId()Indicates when this record was last updated.getName()The name for this role.The id of the parent of this role (if any).The permissions that this role has been directly assigned.inthashCode()booleanIndicates whether this role is an account type role.booleanThis entity is soft-deleted instead of hard-deleted, and this field is set totruewhen the entity is soft-deleted.voidsetAccountRole(boolean accountRole) Indicates whether this role is an account type role.voidsetArchived(boolean archived) This entity is soft-deleted instead of hard-deleted, and this field is set totruewhen the entity is soft-deleted.voidsetDescription(String description) The description of this role for display purposes.voidsetFriendlyName(String friendlyName) The friendly name of this role for display purposes.voidvoidsetLastUpdated(Instant lastUpdated) Indicates when this record was last updated.voidThe name for this role.voidsetParentRoleId(String parentRoleId) The id of the parent of this role (if any).voidsetPermissions(Set<UserPermissionRef> permissions) The permissions that this role has been directly assigned.toRef()toString()
-
Constructor Details
-
UserRole
-
UserRole
public UserRole()
-
-
Method Details
-
getFriendlyName
-
toRef
-
getId
-
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 totruewhen the entity is soft-deleted. -
getLastUpdated
Indicates when this record was last updated. -
getPermissions
The permissions that this role has been directly assigned. The role inherits other permissions from its ancestors as described forparentRoleId. -
getParentRoleId
The id of the parent of this role (if any).This role will effectively inherit all of the
permissionsof 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. -
isAccountRole
public boolean isAccountRole()Indicates whether this role is an account type role. Account roles are roles that may be assigned to account users. Account users are always customers, so these roles are not assignable to admins, whereas non-account roles have no such limitation. In addition, the only permissions that are allowed to be assigned to these roles areaccount permissions. -
getDescription
The description of this role for display purposes. Optional, but recommended for account roles. -
setId
-
setName
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 totruewhen the entity is soft-deleted. -
setLastUpdated
Indicates when this record was last updated. -
setPermissions
The permissions that this role has been directly assigned. The role inherits other permissions from its ancestors as described forparentRoleId. -
setParentRoleId
The id of the parent of this role (if any).This role will effectively inherit all of the
permissionsof 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. -
setAccountRole
public void setAccountRole(boolean accountRole) Indicates whether this role is an account type role. Account roles are roles that may be assigned to account users. Account users are always customers, so these roles are not assignable to admins, whereas non-account roles have no such limitation. In addition, the only permissions that are allowed to be assigned to these roles areaccount permissions. -
setFriendlyName
The friendly name of this role for display purposes. Required for account roles. -
setDescription
The description of this role for display purposes. Optional, but recommended for account roles. -
toString
-
equals
-
canEqual
-
hashCode
public int hashCode()
-