Class QuoteAuthUtils
java.lang.Object
com.broadleafcommerce.cartoperation.service.status.quote.QuoteAuthUtils
- Author:
- Nathan Moore (nathandmoore)
-
Field Summary
-
Constructor Summary
ConstructorDescriptionQuoteAuthUtils
(com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils authenticationUtils) -
Method Summary
Modifier and TypeMethodDescriptionprotected 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 theSALES_REP_PUBLISH_QUOTE_PERMISSION
permission.void
setPolicyUtils
(com.broadleafcommerce.data.tracking.core.policy.trackable.TrackablePolicyUtils policyUtils)
-
Field Details
-
SALES_REP_PUBLISH_QUOTE_PERMISSION
- See Also:
-
-
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 theSALES_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
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 validatecontextInfo
- 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)
-