![]() |
Infohub JS API
|
Data access/service layer for building user aggregates.
Public Member Functions | |
| constructor (ctx=({})) | |
| async | getCurrentUserData () |
| async | getCurrentUserLicences () |
| async | getCurrentUserScopes () |
| async | getGroupsOfUser (userid, projectList=[], catalogueList=[], globalGroups=false) |
| async | getProjectsOfCurrentUser (query={}) |
| async | getUserAvatar (userid) |
| async | getUsers (userids=[], projectid, catalogueid, globalGroups=false, userRoles=false, withInfo=false) |
| async | updateCurrentUserData (data) |
| constructor | ( | ctx = ({}) | ) |
| {Context} | ctx - Context instance |
| async getCurrentUserData | ( | ) |
Get current user's data from IDP# including last chosen role.
| async getCurrentUserLicences | ( | ) |
Get licences of current user current user will be determined by context.
| async getCurrentUserScopes | ( | ) |
Internal: fetch role ids for a user.
Get scopes of current user will be determined by context
| async getGroupsOfUser | ( | userid, | |
| projectList = [], | |||
| catalogueList = [], | |||
| globalGroups = false ) |
Get groups in which user 'userid' is contained.
| {string} | userid |
| {*} | projectList |
| {*} | catalogueList |
| {*} | globalGroups |
| async getProjectsOfCurrentUser | ( | query = {} | ) |
Get projects of the currently logged in user.
The function uses the token stored in the context object.
| {object} | [query] - Query object |
| {string[]} | [query.members=['info']] |
| {string} | [query.filter=''] |
| async getUserAvatar | ( | userid | ) |
Get avatar of a user.
| {string} | userid - The user ID |
| async getUsers | ( | userids = [], | |
| projectid, | |||
| catalogueid, | |||
| globalGroups = false, | |||
| userRoles = false, | |||
| withInfo = false ) |
Build user aggregates, optionally including groups, roles, and contact info.
| {string[]} | userids - Array of user IDs |
| {string} | [projectid] - Project ID |
| {string} | [catalogueid] - Catalogue ID |
| {boolean} | [globalGroups=false] - Include global groups |
| {boolean} | [userRoles=false] - Include user roles |
| {boolean} | [withInfo=false] - Include user contact info |
| async updateCurrentUserData | ( | data | ) |
Update current user's data to IDP.
| {object} | data - The user data |
| {string} | [data.name] - The name |
| {object} | [data.role] - The role object |
| {string} | [data.role.roleid] - The role ID |
| {string} | [data.role.scope] - The scope of the role |