Interface AssociateMissingPermissionError

All Superinterfaces:
ErrorObject

public interface AssociateMissingPermissionError extends ErrorObject

Returned when an Associate is missing a Permission on a B2B resource.


Example to create an instance using the builder pattern

     AssociateMissingPermissionError associateMissingPermissionError = AssociateMissingPermissionError.builder()
             .message("{message}")
             .associate(associateBuilder -> associateBuilder)
             .businessUnit(businessUnitBuilder -> businessUnitBuilder)
             .plusPermissions(permissionsBuilder -> permissionsBuilder)
             .build()
 
  • Field Details

    • ASSOCIATE_MISSING_PERMISSION

      static final String ASSOCIATE_MISSING_PERMISSION
      discriminator value for AssociateMissingPermissionError
      See Also:
  • Method Details

    • getCode

      @NotNull @NotNull String getCode()
      Description copied from interface: ErrorObject

      Error identifier.

      Specified by:
      getCode in interface ErrorObject
      Returns:
      code
    • getMessage

      @NotNull @NotNull String getMessage()
      • When an action is performed by an Associate: "Associate '$idOfAssociate' has no rights to $action in business-unit '$idOrKeyOfBusinessUnit'. Needs '$requiredPermission'."
      • When an action is performed for another Associate, like viewing their Cart: "Associate '$idOfAssociate' has no rights to $action for customer '$idOfCustomer' in business-unit '$idOrKeyOfBusinessUnit'. Needs '$requiredPermission'."
      • When viewing an entity: "Associate '$idOfAssociate' has no rights to $action in business-unit '$idOrKeyOfBusinessUnit'. Needs '$requiredViewMyPermission' or '$requiredViewOthersPermission'."
      Specified by:
      getMessage in interface ErrorObject
      Returns:
      message
    • getAssociate

      @NotNull @Valid @NotNull @Valid CustomerResourceIdentifier getAssociate()

      ResourceIdentifier to the Associate that tried to perform the action.

      Returns:
      associate
    • getBusinessUnit

      @NotNull @Valid @NotNull @Valid BusinessUnitResourceIdentifier getBusinessUnit()

      ResourceIdentifier to the BusinessUnit.

      Returns:
      businessUnit
    • getAssociateOnBehalf

      @Valid @Valid CustomerResourceIdentifier getAssociateOnBehalf()

      ResourceIdentifier of the Associate on whose behalf the action is performed.

      Returns:
      associateOnBehalf
    • getPermissions

      @NotNull @NotNull List<Permission> getPermissions()

      The Permissions that the Associate performing the action lacks. At least one of these Permissions is needed.

      Returns:
      permissions
    • setMessage

      void setMessage(String message)
      • When an action is performed by an Associate: "Associate '$idOfAssociate' has no rights to $action in business-unit '$idOrKeyOfBusinessUnit'. Needs '$requiredPermission'."
      • When an action is performed for another Associate, like viewing their Cart: "Associate '$idOfAssociate' has no rights to $action for customer '$idOfCustomer' in business-unit '$idOrKeyOfBusinessUnit'. Needs '$requiredPermission'."
      • When viewing an entity: "Associate '$idOfAssociate' has no rights to $action in business-unit '$idOrKeyOfBusinessUnit'. Needs '$requiredViewMyPermission' or '$requiredViewOthersPermission'."
      Specified by:
      setMessage in interface ErrorObject
      Parameters:
      message - value to be set
    • setAssociate

      void setAssociate(CustomerResourceIdentifier associate)

      ResourceIdentifier to the Associate that tried to perform the action.

      Parameters:
      associate - value to be set
    • setBusinessUnit

      void setBusinessUnit(BusinessUnitResourceIdentifier businessUnit)

      ResourceIdentifier to the BusinessUnit.

      Parameters:
      businessUnit - value to be set
    • setAssociateOnBehalf

      void setAssociateOnBehalf(CustomerResourceIdentifier associateOnBehalf)

      ResourceIdentifier of the Associate on whose behalf the action is performed.

      Parameters:
      associateOnBehalf - value to be set
    • setPermissions

      void setPermissions(Permission... permissions)

      The Permissions that the Associate performing the action lacks. At least one of these Permissions is needed.

      Parameters:
      permissions - values to be set
    • setPermissions

      void setPermissions(List<Permission> permissions)

      The Permissions that the Associate performing the action lacks. At least one of these Permissions is needed.

      Parameters:
      permissions - values to be set
    • of

      factory method
      Returns:
      instance of AssociateMissingPermissionError
    • of

      factory method to create a shallow copy AssociateMissingPermissionError
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      factory method to create a deep copy of AssociateMissingPermissionError
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      builder factory method for AssociateMissingPermissionError
      Returns:
      builder
    • builder

      create builder for AssociateMissingPermissionError instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withAssociateMissingPermissionError

      default <T> T withAssociateMissingPermissionError(Function<AssociateMissingPermissionError,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<AssociateMissingPermissionError> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference