java.lang.Object
com.broadleafcommerce.adminuser.resource.domain.AdminRoleRef
All Implemented Interfaces:
Serializable

public class AdminRoleRef extends Object implements Serializable
A representation of a role.
See Also:
  • Constructor Details

    • AdminRoleRef

      public AdminRoleRef()
  • Method Details

    • getAttribute

      @Nullable public Object getAttribute(String name)
      Get the value of an attribute. May return null.
      Parameters:
      name - The attribute name.
      Returns:
      The attribute value if it exists, or null.
    • addAttribute

      public void addAttribute(String name, Object value)
      Add an attribute to the attributes map.
      Parameters:
      name - The attribute key.
      value - The attribute value.
    • getId

      public String getId()
      The ID of this role as it exists in the system where roles are stored (default storage is Auth)
    • getName

      public String getName()
      The name of this role. Must be hydrated.
    • getTenantId

      public String getTenantId()
      The tenant ID of this role. TODO This currently appears to have no effect. Other than direct DB inserts, there is no valid way to set this value.
    • getAttributes

      public Map<String,Object> getAttributes()
      Contains any additional properties of a role that do not fit in the above fields.
    • getParentRoleId

      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.

      Global roles can only have global parents, while tenant roles can have parents from global or the same tenant.

      Furthermore, there is validation in place to prevent cycles from being created in a role's ancestry (role cannot become a parent of itself).

    • getPermissions

      public Set<AdminPermissionRef> getPermissions()
    • isThirdPartyAssigned

      public boolean isThirdPartyAssigned()
      Indicate if this role was assigned by a third party system
    • setId

      public void setId(String id)
      The ID of this role as it exists in the system where roles are stored (default storage is Auth)
    • setName

      public void setName(String name)
      The name of this role. Must be hydrated.
    • setTenantId

      public void setTenantId(String tenantId)
      The tenant ID of this role. TODO This currently appears to have no effect. Other than direct DB inserts, there is no valid way to set this value.
    • setAttributes

      public void setAttributes(Map<String,Object> attributes)
      Contains any additional properties of a role that do not fit in the above fields.
    • setParentRoleId

      public void setParentRoleId(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.

      Global roles can only have global parents, while tenant roles can have parents from global or the same tenant.

      Furthermore, there is validation in place to prevent cycles from being created in a role's ancestry (role cannot become a parent of itself).

    • setPermissions

      public void setPermissions(Set<AdminPermissionRef> permissions)
    • setThirdPartyAssigned

      public void setThirdPartyAssigned(boolean thirdPartyAssigned)
      Indicate if this role was assigned by a third party system
    • 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
    • toString

      public String toString()
      Overrides:
      toString in class Object