Class

UserServices

UserServices(ctx)

Data access/service layer for building user aggregates.

Constructor

# new UserServices(ctx)

Parameters:
Name Type Description
ctx Context

Context instance

Since:
  • 09.2025, aab

View Source infohub/User.js, line 151

Classes

UserServices

Methods

# async getCurrentUserData() → {Promise.<ApiResponse>}

Get current user's data from IDP# including last chosen role

View Source infohub/User.js, line 534

Promise.<ApiResponse>

# async getCurrentUserLicences() → {Promise.<ApiResponse>}

Get licences of current user current user will be determined by context

View Source infohub/User.js, line 376

User

Promise.<ApiResponse>

# async getCurrentUserScopes() → {Promise.<{status: number, data: any}>}

Internal: fetch role ids for a user. Get scopes of current user will be determined by context

View Source infohub/User.js, line 392

Promise.<{status: number, data: any}>

# async getGroupsOfUser(userid, projectList, catalogueList, globalGroups) → {Promise.<ApiResponse>}

Get groups in which user 'userid' is contained.

Parameters:
Name Type Default Description
userid string
projectList *
catalogueList *
globalGroups * false

View Source infohub/User.js, line 455

Promise.<ApiResponse>
Example
{
   'status' : 200
   'data'   : {
     'projectgroups' : [],
     'cataloguegroups' : [],
     'globalgroups' : []
   }
}

# async getProjectsOfCurrentUser(queryopt) → {Promise.<ApiResponse>}

Get projects of the currently logged in user.
The function uses the token stored in the context object.

Parameters:
Name Type Attributes Default Description
query object <optional>

Query object

members Array.<string> <optional>
['info']
filter string <optional>
''
Since:
  • 10.2025, aab

View Source infohub/User.js, line 336

ApiResponse with list of json objects :

Promise.<ApiResponse>

# async getUserAvatar(userid) → {Promise.<{status: number, data: any}>}

Get avatar of a user

Parameters:
Name Type Description
userid string

The user ID

View Source infohub/User.js, line 509

Promise.<{status: number, data: any}>

# async getUsers(userids, projectidopt, catalogueidopt, globalGroupsopt, userRolesopt, withInfoopt) → {Promise.<ApiResponse>}

Build user aggregates, optionally including groups, roles, and contact info.

Parameters:
Name Type Attributes Default Description
userids Array.<string>

Array of user IDs

projectid string <optional>

Project ID

catalogueid string <optional>

Catalogue ID

globalGroups boolean <optional>
false

Include global groups

userRoles boolean <optional>
false

Include user roles

withInfo boolean <optional>
false

Include user contact info

View Source infohub/User.js, line 607

  • The response object
Promise.<ApiResponse>

# async updateCurrentUserData(data) → {Promise.<ApiResponse>}

Update current user's data to IDP

Parameters:
Name Type Attributes Description
data object

The user data

name string <optional>

The name

roleid string <optional>

The role ID

View Source infohub/User.js, line 555

Promise.<ApiResponse>