java.lang.Object
com.broadleafcommerce.cartoperation.service.status.quote.QuoteAuthUtils

public class QuoteAuthUtils extends Object
Author:
Nathan Moore (nathandmoore)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    QuoteAuthUtils(com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils authenticationUtils)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils
     
    getCurrentUserEmail(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Determine the id of the currently authenticated user.
    getCurrentUserId(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Determine the id of the currently authenticated user.
    getCurrentUserType(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Determine the user type of the currently authenticated user.
    protected com.broadleafcommerce.data.tracking.core.policy.trackable.TrackablePolicyUtils
     
    Gets the permission for sales reps to publish quote.
    protected boolean
    hasPermissions(@NonNull Set<String> requiredPermissions, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Validates that the currently authenticated user has the given permissions.
    boolean
    isSalesRep(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Determines if the currently authenticated user is a sales rep.
    boolean
    isSalesRepWithPublishQuotePermission(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Determines if the currently authenticated user is a sales rep with the SALES_REP_PUBLISH_QUOTE_PERMISSION permission.
    void
    setPolicyUtils(com.broadleafcommerce.data.tracking.core.policy.trackable.TrackablePolicyUtils policyUtils)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • QuoteAuthUtils

      public QuoteAuthUtils(com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils authenticationUtils)
  • Method Details

    • isSalesRep

      public boolean isSalesRep(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Determines if the currently authenticated user is a sales rep.
      Parameters:
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      true if the currently authenticated user is a sales rep, otherwise false
    • isSalesRepWithPublishQuotePermission

      public boolean isSalesRepWithPublishQuotePermission(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Determines if the currently authenticated user is a sales rep with the SALES_REP_PUBLISH_QUOTE_PERMISSION permission.
      Parameters:
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      true if the currently authenticated user is a sales rep with the publish quote permission, otherwise false
    • getSalesRepPublishQuotePermission

      public String getSalesRepPublishQuotePermission()
      Gets the permission for sales reps to publish quote.
    • getCurrentUserType

      public String getCurrentUserType(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Determine the user type of the currently authenticated user.
      Parameters:
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      the user type of the currently authenticated user
      See Also:
      • DefaultUserTypes
    • getCurrentUserId

      public String getCurrentUserId(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Determine the id of the currently authenticated user.
      Parameters:
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      the id of the currently authenticated user
    • getCurrentUserEmail

      public String getCurrentUserEmail(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Determine the id of the currently authenticated user.
      Parameters:
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      the id of the currently authenticated user
    • hasPermissions

      protected boolean hasPermissions(@NonNull @NonNull Set<String> requiredPermissions, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Validates that the currently authenticated user has the given permissions.
      Parameters:
      requiredPermissions - a set of required permissions to validate
      contextInfo - context information surrounding sandboxing and multitenant state
    • getAuthenticationUtils

      protected com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils getAuthenticationUtils()
    • getPolicyUtils

      @Nullable protected com.broadleafcommerce.data.tracking.core.policy.trackable.TrackablePolicyUtils getPolicyUtils()
    • setPolicyUtils

      @Autowired(required=false) public void setPolicyUtils(com.broadleafcommerce.data.tracking.core.policy.trackable.TrackablePolicyUtils policyUtils)