Interface SubscriptionAccessValidationService
- All Known Implementing Classes:
DefaultSubscriptionAccessValidationService
public interface SubscriptionAccessValidationService
Performs validation to check the accessibility of the subscriptions for the user.
- Author:
- karanjariwala
-
Method Summary
Modifier and TypeMethodDescription<SWI extends SubscriptionWithItems>
Collection<SWI>getAccessibleSubscriptions(String[] permissionRoots, Collection<SWI> subscriptionWithItems, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Filters aCollectionof thesubscriptionWithItemsand returns those subscriptions that are accessible to the current user (customer or account).<SWI extends SubscriptionWithItems>
org.springframework.data.domain.Page<SWI>getAccessibleSubscriptions(String[] permissionRoots, org.springframework.data.domain.Page<SWI> subscriptionWithItems, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Filters aPageof thesubscriptionWithItemsand returns those subscriptions that are accessible to the current user (customer or account).voidvalidateAccess(String[] permissionRoots, String subscriptionId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Validates whether the current user is restricted to certain subscriptions only.
-
Method Details
-
validateAccess
void validateAccess(String[] permissionRoots, String subscriptionId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Validates whether the current user is restricted to certain subscriptions only. And if restricted, validates that the user is allowed to access the givensubscriptionId.- Parameters:
permissionRoots- the permissionRoots that the user's access is to be checked forsubscriptionId- the subscription whose access is to be checkedcontextInfo- the context information around multi-tenant state
-
getAccessibleSubscriptions
<SWI extends SubscriptionWithItems> Collection<SWI> getAccessibleSubscriptions(String[] permissionRoots, Collection<SWI> subscriptionWithItems, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Filters aCollectionof thesubscriptionWithItemsand returns those subscriptions that are accessible to the current user (customer or account).- Parameters:
permissionRoots- the permissionRoots that the user's access is to be checked forsubscriptionWithItems- the collection of subscriptions to be filteredcontextInfo- the context information around multi-tenant state- Returns:
- a
CollectionofSubscriptionWithItemsthat the current user can access
-
getAccessibleSubscriptions
<SWI extends SubscriptionWithItems> org.springframework.data.domain.Page<SWI> getAccessibleSubscriptions(String[] permissionRoots, org.springframework.data.domain.Page<SWI> subscriptionWithItems, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Filters aPageof thesubscriptionWithItemsand returns those subscriptions that are accessible to the current user (customer or account).- Parameters:
permissionRoots- the permissionRoots that the user's access is to be checked forsubscriptionWithItems- the page of subscriptions to be filteredcontextInfo- the context information around multi-tenant state- Returns:
- a
PageofSubscriptionWithItemsthat the current user can access
-