From fe62dc8120f31dae07dbe562a1c59892dfc1157d Mon Sep 17 00:00:00 2001 From: Gisler Date: Fri, 8 May 2020 16:18:26 -0500 Subject: [PATCH] ENG-3124: Nepalizing portero (missing endpoint in nepal) (#11) --- package.json | 2 +- src/aims-client/aims-client.ts | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 934e563c..72b18c36 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@al/core", - "version": "1.0.9", + "version": "1.0.10", "description": "Nepal Core", "main": "./dist/index.cjs.js", "types": "./dist/index.d.ts", diff --git a/src/aims-client/aims-client.ts b/src/aims-client/aims-client.ts index 2a8ae694..9767fe11 100644 --- a/src/aims-client/aims-client.ts +++ b/src/aims-client/aims-client.ts @@ -371,6 +371,21 @@ export class AIMSClientInstance { return role as AIMSRole; } + /** + * Get assigned roles + * GET + * /aims/v1/:account_id/users/:user_id/roles + * "https://api.cloudinsight.alertlogic.com/aims/v1/12345678/users/715A4EC0-9833-4D6E-9C03-A537E3F98D23/roles" + */ + async getAssignedRoles( accountId:string, userId:string ):Promise { + const roles = await this.client.get({ + service_name: this.serviceName, + account_id: accountId, + path: `/users/${userId}/roles` + }); + return roles.roles; + } + /** * List global roles, roles that are shared among all accounts. * GET