Class UserRole
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
The 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.int
hashCode()
boolean
Indicates whether this role is an account type role.boolean
This entity is soft-deleted instead of hard-deleted, and this field is set totrue
when the entity is soft-deleted.void
setAccountRole
(boolean accountRole) Indicates whether this role is an account type role.void
setArchived
(boolean archived) This entity is soft-deleted instead of hard-deleted, and this field is set totrue
when the entity is soft-deleted.void
setDescription
(String description) The description of this role for display purposes.void
setFriendlyName
(String friendlyName) The friendly name of this role for display purposes.void
void
setLastUpdated
(Instant lastUpdated) Indicates when this record was last updated.void
The name for this role.void
setParentRoleId
(String parentRoleId) The id of the parent of this role (if any).void
setPermissions
(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 totrue
when 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
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
. -
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 totrue
when 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
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
. -
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()
-