Class DefaultCustomerAccountService<A extends Account,​M extends AccountMember>

    • Constructor Detail

      • DefaultCustomerAccountService

        public DefaultCustomerAccountService​(AccountMemberService<M> accountMemberService,
                                             AccountService<A> accountService,
                                             com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils authenticationUtils)
    • Method Detail

      • readAccountMembers

        public org.springframework.data.domain.Page<M> readAccountMembers​(String accountId,
                                                                          @Nullable
                                                                          cz.jirutka.rsql.parser.ast.Node filters,
                                                                          @Nullable
                                                                          org.springframework.data.domain.Pageable page,
                                                                          @Nullable
                                                                          com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Description copied from interface: CustomerAccountService
        Read the AccountMembers for a specific Account by id.
        Specified by:
        readAccountMembers in interface CustomerAccountService<A extends Account,​M extends AccountMember>
        Parameters:
        accountId - Id of the parent account
        filters - RSQL filters
        page - Pagination info
        contextInfo - Additional multitenant and sandbox info
        Returns:
        The AccountMembers for a specific Account by id.
      • readMyAccounts

        public List<A> readMyAccounts​(int childAccountDepth,
                                      boolean filterParents,
                                      @Nullable
                                      cz.jirutka.rsql.parser.ast.Node filters,
                                      @Nullable
                                      com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Description copied from interface: CustomerAccountService
        Reads the currently logged in user's Accounts. Set excludeAccountsWithInactiveParent to true to filter out accounts that have a disabled parent account.
        Specified by:
        readMyAccounts in interface CustomerAccountService<A extends Account,​M extends AccountMember>
        Parameters:
        childAccountDepth - How many levels deep of the account hierarchy of the accounts matching ids to include in the results, e.g., how many levels of child accounts to include. -1 indicates no limit. 0 indicates no child accounts.

        Default is 0.

        filterParents - If true, the returned list will include only accounts with active parent accounts.
        filters - An RSQL filter used to narrow query results. May be EmptyNode if no filters should be applied.
        contextInfo - Additional multitenant and sandbox info
        Returns:
        The currently logged in user's Accounts.
      • validateUserNotModifyingThemselves

        protected void validateUserNotModifyingThemselves​(@NonNull
                                                          @NonNull AccountMember accountMember,
                                                          @Nullable
                                                          com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      • validateAccountIdMatchesContext

        protected void validateAccountIdMatchesContext​(String accountId,
                                                       @Nullable
                                                       com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      • getAuthenticationUtils

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