Class: IAMInterface

IAMInterface

Exposes an interface for interaction with iam endpoints in the backend

Methods

(async) addRole(role) → {String}

add a role

Parameters:
Name Type Description
role String

role representation

Source:
Returns:
  • name of created role
Type
String

(async) addRoleForUser(userId, roles) → {Object}

add roles to a specified user

Parameters:
Name Type Description
userId String

the id of the user

roles Array

array of role representations for the user

Source:
Returns:
  • id of the user
Type
Object

(async) addShare(share) → {Object}

add a new share

Parameters:
Name Type Description
share Object

the new share object

Properties
Name Type Description
permissions Number

allowed permissions (mandatory)

resourceType String

type of resource (mandatory)

resourceId String

id of resource (mandatory)

type 0 | 1 | 2

type of sharing (mandatory) - 0 = sharing from user to user, 1 = sharing from user to group, 2 = link sharing

sharedWith String

id of a user (mandatory if not link sharing)

password String

password for a link sharing (only for type link, optional)

expiredAt Date

date when a sharing should expire (optional)

note String

a note for users that receive the sharing (optional)

Source:
Returns:
  • new share object
Type
Object

(async) addUser(user) → {String}

add a new user to the realm

Parameters:
Name Type Description
user Object

representation of a user, MUST additionally contain key "password" with temporary password for user

Source:
Returns:
  • id of created user
Type
String

(async) deleteRoleById(roleId) → {String}

delete an existing role

Parameters:
Name Type Description
roleId String

the id of the existing role

Source:
Returns:
  • id of deleted role
Type
String

(async) deleteRoleFromUser(userId, roles) → {Object}

remove a role of a specified user

Parameters:
Name Type Description
userId String

the id of the user

roles Array

array of role representations

Source:
Returns:
  • id of the user
Type
Object

(async) deleteShareById(shareId) → {String}

delete an existing share

Parameters:
Name Type Description
shareId String

the id of a share object

Source:
Returns:
  • id of deleted share object
Type
String

(async) deleteUser(userId) → {String}

delete a user

Parameters:
Name Type Description
userId String

the id of the user

Source:
Returns:
  • id of deleted user
Type
String

(async) getAllUsers() → {Array}

get all users from authorization server

Source:
Returns:
  • array of user representations
Type
Array

(async) getGroupsFromUser(userId) → {Array}

get the groups from a user

Parameters:
Name Type Description
userId String

the id of the user

Source:
Returns:
  • array of group representations
Type
Array

(async) getResources() → {Array}

get all resources

Source:
Returns:
  • all resources
Type
Array

(async) getRoleById(roleId) → {Object}

get the detailled role information of a role

Parameters:
Name Type Description
roleId String

the id of the role

Source:
Returns:
  • role representation
Type
Object

(async) getRoles(name) → {Object|Array}

get role representation if name is set, otherwise returns all roles

Parameters:
Name Type Default Description
name String null

name of role

Source:
Returns:
  • role representation or array of role representations
Type
Object | Array

(async) getRolesFromUser(userId) → {Array}

get the roles from a user

Parameters:
Name Type Description
userId String

the id of the user

Source:
Returns:
  • array of role representations
Type
Array

(async) getShareById(shareId) → {Object}

get a share by id

Parameters:
Name Type Description
shareId String

the id of of a share object

Source:
Returns:
  • share object
Type
Object

(async) getShares(query) → {Array}

get all shares (user, group and link sharings)

Parameters:
Name Type Description
query String

query string to filter shares - available query string are resourceId (id of a resource), resourceType (type of a resource e.g. Process), shareType (type of a share e.g. 0 = user sharing), userId (id of a user)

Source:
Returns:
  • shares array
Type
Array

(async) getUserById(userId) → {Object}

get the detailled user representation

Parameters:
Name Type Description
userId String

the id of the user

Source:
Returns:
  • user representation
Type
Object

(async) updatePassword(userId, password) → {String}

updates password of a user

Parameters:
Name Type Description
userId String

the id of the user

password String

new password for user

Source:
Returns:
  • id of updated user
Type
String

(async) updateRoleById(roleId, role) → {String}

update an existing role

Parameters:
Name Type Description
roleId String

the id of the existing role

role Object

updated role representation

Source:
Returns:
  • id of updated role
Type
String

(async) updateShareById(shareId, share) → {Object}

update an existing share

Parameters:
Name Type Description
shareId String

the id of a share object

share Object

the updated share object properties

Properties
Name Type Description
permissions Number

allowed permissions (optional)

password String

password for a link sharing (only for type link, optional)

expiredAt Date

date when a sharing should expire (optional)

note String

a note for users that receive the sharing (optional)

Source:
Returns:
  • updated share object
Type
Object

(async) updateUser(userId, user) → {String}

update a specified user

Parameters:
Name Type Description
userId String

the id of the user

user Object

updated representation of a user

Source:
Returns:
  • id of updated user
Type
String