Package de.hybris.platform.b2b.services
Interface B2BPermissionService<T extends UserModel,P extends B2BPermissionResultModel>
-
- Type Parameters:
T
- the user (subtype ofUserModel
)P
- the permission result (subtype ofB2BPermissionResultModel
)
- All Known Implementing Classes:
DefaultB2BPermissionService
public interface B2BPermissionService<T extends UserModel,P extends B2BPermissionResultModel>
A service aroundB2BPermissionResultModel
. This interface evaluates the permissions(credit limits or budget thresholds) on an order to determine if the order needs to be sent for approval. If the order needs to be approved, the associated approver is applied to the permission so that an Approve or Reject decision on the order can be made.- Spring Bean ID:
- b2bPermissionService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description java.util.Set<P>
evaluatePermissions(AbstractOrderModel order, T employee, java.util.List<java.lang.Class<? extends B2BPermissionModel>> permissionTypes)
Evaluate permissions of an order to determine if a violation has occurred and that an approver needs to intervene and approve/reject an order.java.util.Set<B2BPermissionModel>
findAllB2BPermissions()
Deprecated.As of hybris 4.4, replaced bygetAllB2BPermissions()
java.util.List<java.lang.String>
findAllB2BPermissionTypes()
Deprecated.As of hybris 4.4, replaced bygetAllB2BPermissionTypes()
java.util.Set<P>
findApproversForOpenPermissions(AbstractOrderModel order, T customer, java.util.Collection<P> openPermissions)
Deprecated.As of hybris 4.4, replaced bygetApproversForOpenPermissions(AbstractOrderModel, UserModel, Collection)
B2BPermissionModel
findB2BPermissionByCode(java.lang.String code)
Deprecated.As of hybris 4.4, replaced bygetB2BPermissionForCode(String)
java.util.Set<B2BPermissionModel>
getAllB2BPermissions()
Get all b2b permissions.java.util.List<java.lang.String>
getAllB2BPermissionTypes()
Get all permission typesjava.util.Set<P>
getApproversForOpenPermissions(AbstractOrderModel order, T customer, java.util.Collection<P> openPermissions)
Get the approvers for an order's associated permissions with a status of OPEN.B2BPermissionModel
getB2BPermissionForCode(java.lang.String code)
Gets the b2b permission for the code provided.java.util.Map<T,P>
getEligableApprovers(OrderModel order)
Get all approvers who have permissions to approve the order.java.util.List<P>
getOpenPermissions(AbstractOrderModel order)
Gets permissions with OPEN status.boolean
needsApproval(AbstractOrderModel order)
Checks if the order requires approval by someone other than customer who placed the order.boolean
permissionExists(java.lang.String code)
Determine if a b2b permission exists based on a code.
-
-
-
Method Detail
-
evaluatePermissions
java.util.Set<P> evaluatePermissions(AbstractOrderModel order, T employee, java.util.List<java.lang.Class<? extends B2BPermissionModel>> permissionTypes)
Evaluate permissions of an order to determine if a violation has occurred and that an approver needs to intervene and approve/reject an order.- Parameters:
order
- the order to be evaluatedemployee
- the person who placed the orderpermissionTypes
- the permission types that will be checked- Returns:
- the set of
B2BPermissionResultModel
-
findApproversForOpenPermissions
@Deprecated(since="4.4") java.util.Set<P> findApproversForOpenPermissions(AbstractOrderModel order, T customer, java.util.Collection<P> openPermissions)
Deprecated.As of hybris 4.4, replaced bygetApproversForOpenPermissions(AbstractOrderModel, UserModel, Collection)
- Parameters:
order
- the ordercustomer
- the customeropenPermissions
- permissions that need approval- Returns:
- the set of
B2BPermissionResultModel
-
getApproversForOpenPermissions
java.util.Set<P> getApproversForOpenPermissions(AbstractOrderModel order, T customer, java.util.Collection<P> openPermissions)
Get the approvers for an order's associated permissions with a status of OPEN. Approvers are assigned to a customer or it's unit and this evaluates/gathers the approvers for all units up the hierarchy.- Parameters:
order
- the ordercustomer
- the customer whom placed the orderopenPermissions
- the permissions to be checked for status of OPEN- Returns:
- B2BPermissionResult the set of approvers
-
getOpenPermissions
java.util.List<P> getOpenPermissions(AbstractOrderModel order)
Gets permissions with OPEN status.- Parameters:
order
- the order- Returns:
- the open permissions
-
findB2BPermissionByCode
@Deprecated(since="4.4") B2BPermissionModel findB2BPermissionByCode(java.lang.String code)
Deprecated.As of hybris 4.4, replaced bygetB2BPermissionForCode(String)
- Parameters:
code
- the permission code- Returns:
- the permission
-
getB2BPermissionForCode
B2BPermissionModel getB2BPermissionForCode(java.lang.String code)
Gets the b2b permission for the code provided.- Parameters:
code
- the code- Returns:
- the b2b permission model
-
findAllB2BPermissions
@Deprecated(since="4.4") java.util.Set<B2BPermissionModel> findAllB2BPermissions()
Deprecated.As of hybris 4.4, replaced bygetAllB2BPermissions()
- Returns:
- the set of
B2BPermissionModel
-
getAllB2BPermissions
java.util.Set<B2BPermissionModel> getAllB2BPermissions()
Get all b2b permissions.- Returns:
- the set of B2BPermissionModel
-
permissionExists
boolean permissionExists(java.lang.String code)
Determine if a b2b permission exists based on a code.- Parameters:
code
- the code- Returns:
- True if permission exists
-
needsApproval
boolean needsApproval(AbstractOrderModel order)
Checks if the order requires approval by someone other than customer who placed the order.- Parameters:
order
- A b2b order.- Returns:
- True if order needs approval.
-
getEligableApprovers
java.util.Map<T,P> getEligableApprovers(OrderModel order)
Get all approvers who have permissions to approve the order.- Parameters:
order
- A b2b order- Returns:
- approvers who are eligible to approve the order.
-
findAllB2BPermissionTypes
@Deprecated(since="4.4") java.util.List<java.lang.String> findAllB2BPermissionTypes()
Deprecated.As of hybris 4.4, replaced bygetAllB2BPermissionTypes()
- Returns:
- the
List
of permission types
-
getAllB2BPermissionTypes
java.util.List<java.lang.String> getAllB2BPermissionTypes()
Get all permission types- Returns:
- permission types list
-
-