UNPKG

@itwin/access-control-client

Version:

Access control client for the iTwin platform

24 lines 998 B
import { BaseClient } from "./BaseClient"; export class PermissionsClient extends BaseClient { constructor(url) { super(url); } /** Retrieves the list of all available permissions * @param accessToken The client access token string * @returns Array of permissions */ async getPermissionsAsync(accessToken) { const url = `${this._baseUrl}/permissions`; return this.sendGenericAPIRequest(accessToken, "GET", url, undefined, "permissions"); } /** Retrieves a list of permissions the identity has for a specified iTwin * @param accessToken The client access token string * @param iTwinId The id of the iTwin * @returns Array of permissions */ async getITwinPermissionsAsync(accessToken, iTwinId) { const url = `${this._baseUrl}/${iTwinId}/permissions`; return this.sendGenericAPIRequest(accessToken, "GET", url, undefined, "permissions"); } } //# sourceMappingURL=PermissionsClient.js.map