Skip to content

Commit 1b1ed08

Browse files
Merge pull request #159 from terminusdb/fix-lint
review docs
2 parents eb72961 + 0fc3c0c commit 1b1ed08

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lib/accessControl.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ AccessControl.prototype.updateOrgInviteStatus = function (inviteId, accepted, or
381381
* })
382382
*
383383
* //this function will return an array of capabilities with users and roles
384+
* //response array example
384385
* //[{capability: "Capability/3ea26e1d698821c570afe9cb4fe81a3......"
385386
* // email: {@type: "xsd:string", @value: "[email protected]"}
386387
* // picture: {@type: "xsd:string",…}
@@ -403,6 +404,20 @@ AccessControl.prototype.getOrgUsers = function (orgName) {
403404
return this.dispatch(`${this.baseURL}/organizations/${UTILS.encodeURISegment(org)}/users`, CONST.GET);
404405
};
405406

407+
/**
408+
* Get the user role for a given organization or the default organization,
409+
* The user is identified by the jwt or the access token
410+
* @param {string} [orgName] - The organization name.
411+
* @return {Promise} A promise that returns the call response object, or an Error if rejected.
412+
* @example
413+
* accessControl.getTeamUserRole().then(result=>{
414+
* console.log(result)
415+
* })
416+
*
417+
* //response object example
418+
* {"userRole":"Role/admin"}
419+
*/
420+
406421
AccessControl.prototype.getTeamUserRole = function (orgName) {
407422
if (!orgName && !this.defaultOrganization) {
408423
return Promise.reject(

0 commit comments

Comments
 (0)