Anuj Sharma
Anuj Sharma

Reputation: 65

How can I detect current user's User-Group in Spartacus

I have a requirement to get the current user's User-Group in Angular Application with Spartacus.

I saw, there are OOTB controllers inside Hybris but no way to call them from spartacus.

Upvotes: 0

Views: 359

Answers (1)

Michał Gruca
Michał Gruca

Reputation: 413

You have to use B2BUserService. There is a method designed to load and return that data:

  getUserGroups(
    orgCustomerId: string,
    params: SearchConfig
  ): Observable<EntitiesModel<UserGroup>>

Upvotes: 2

Related Questions