java.lang.Object
com.broadleafcommerce.auth.resource.domain.UserRole

public class UserRole extends Object
  • Constructor Details

    • UserRole

      public UserRole(String name)
    • UserRole

      public UserRole()
  • Method Details

    • getFriendlyName

      public String getFriendlyName()
    • 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 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:
    • 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 are account permissions.
    • getDescription

      public String getDescription()
      The description of this role for display purposes. Optional, but recommended for account roles.
    • 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:
    • 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 are account permissions.
    • setFriendlyName

      public void setFriendlyName(String friendlyName)
      The friendly name of this role for display purposes. Required for account roles.
    • setDescription

      public void setDescription(String description)
      The description of this role for display purposes. Optional, but recommended for account roles.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object