Class UserRole
- java.lang.Object
-
- com.broadleafcommerce.auth.resource.domain.UserRole
-
public class UserRole extends Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canEqual(Object other)
boolean
equals(Object o)
String
getId()
Instant
getLastUpdated()
Indicates when this record was last updated.String
getName()
The name for this role.String
getParentRoleId()
The id of the parent of this role (if any).Set<UserPermissionRef>
getPermissions()
The permissions that this role has been directly assigned.int
hashCode()
boolean
isArchived()
This entity is soft-deleted instead of hard-deleted, and this field is set totrue
when the entity is soft-deleted.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
setId(String id)
void
setLastUpdated(Instant lastUpdated)
Indicates when this record was last updated.void
setName(String name)
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.UserRoleRef
toRef()
String
toString()
-
-
-
Constructor Detail
-
UserRole
public UserRole(String name)
-
UserRole
public UserRole()
-
-
Method Detail
-
toRef
public UserRoleRef toRef()
-
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 totrue
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 forparentRoleId
.
-
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
.
-
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 totrue
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 forparentRoleId
.
-
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
.
-
canEqual
protected boolean canEqual(Object other)
-
-