How to use the @alfresco/js-api.GroupsApi function in @alfresco/js-api

To help you get started, we’ve selected a few @alfresco/js-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Alfresco / alfresco-content-app / src / app / app.component.ts View on Github external
private async loadUserProfile() {
    const groupsApi = new GroupsApi(this.alfrescoApiService.getInstance());
    const paging = await groupsApi.listGroupMembershipsForPerson('-me-');
    const groups: Group[] = [];

    if (paging && paging.list && paging.list.entries) {
      groups.push(...paging.list.entries.map(obj => obj.entry));
    }

    this.contentApi.getPerson('-me-').subscribe(person => {
      this.store.dispatch(
        new SetUserProfileAction({ person: person.entry, groups })
      );
    });
  }