Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 31 additions & 2 deletions src/pages/services/aem-assets-view/api/commons/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ All API invocations are asynchronous and return a `Promise`.

### Authentication API

This API provides information about the current Org, access token and API key in the AEM Assets View.
The API uses `auth` namespace.
This API provides information about the current Org, access token and API key in the AEM Assets View, as well as
the signed-in user's profile and group membership. The API uses `auth` namespace.

`auth.getIMSInfo()`

Expand All @@ -157,6 +157,35 @@ const { imsOrg, accessToken } = await guestConnection.host.auth.getIMSInfo();
const apiKey = await guestConnection.host.auth.getApiKey();
```

`auth.getCurrentUserProfile()`

**Description:** returns basic profile information about the currently signed-in user.

**Return Object Structure**
- `name` (`string`): The user's display name.
- `userId` (`string`): The user's IMS identifier.
- `email` (`string`): The user's email address.

**Example:**
```js
const { name, userId, email } = guestConnection.host.auth.getCurrentUserProfile();
```

`auth.getCurrentUserGroupMembership()`

**Description:** returns the groups the currently signed-in user belongs to within the current Org. Only groups linked
to an IMS group are returned. This API is asynchronous and returns a `Promise`.

**Return Object Structure** (`Array` of objects, each with the following properties):
- `name` (`string`): The group name.
- `linkedGroupId` (`number`): The identifier of the linked IMS group.

**Example:**
```js
const groups = await guestConnection.host.auth.getCurrentUserGroupMembership();
// groups: [{ name: 'Marketing', linkedGroupId: 875881973 }, ...]
```

### Discovery API

This API provides information AEM author instance location.
Expand Down