Class

UserGroupServices

UserGroupServices(ctx)

Service layer for CRUD operations on user groups.

Constructor

# new UserGroupServices(ctx)

Parameters:
Name Type Description
ctx cnContext

Context instance

Since:
  • 09.2025, aab

View Source infohub/UserGroup.js, line 95

Classes

UserGroupServices

Methods

# async addUserToGroup(groupid, dataopt) → {Promise.<ApiResponse>}

Add a user to a group.

Parameters:
Name Type Attributes Description
groupid string

The group ID

data object <optional>

Payload

parentid string <optional>

The parent ID

userrelations Array.<object> <optional>

The user relations of the group

userrelations[].userid string <optional>

The user ID

userrelations[].roles Array.<string> <optional>

The roles of the user

userrelations[].companyid string <optional>

The company ID

userrelations[].userconfig object <optional>

The user config

View Source infohub/UserGroup.js, line 260

Promise.<ApiResponse>

# async createGroup(projCatId, type, dataopt) → {Promise.<ApiResponse>}

Create a new user group.

Parameters:
Name Type Attributes Description
projCatId string

The project or catalogue ID

type string

The type of group (project or catalogue)

data object <optional>

Group payload

name string <optional>

The name of the group

description string <optional>

The description of the group

permissions object <optional>

The permissions of the group

users Array.<string> <optional>

The users of the group

roles Array.<string> <optional>

The roles of the group

userrelations Array.<string> <optional>

The user relations of the group

invitations Array.<string> <optional>

The invitations of the group

View Source infohub/UserGroup.js, line 120

Promise.<ApiResponse>

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

Delete a user group.

Parameters:
Name Type Description
groupid string

The group ID

View Source infohub/UserGroup.js, line 220

Promise.<ApiResponse>

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

List global (scope‑wide) groups.

Parameters:
Name Type Attributes Description
query object <optional>

The query parameters

filter string <optional>

The filter

members string <optional>

The members

View Source infohub/UserGroup.js, line 594

Promise.<ApiResponse>

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

Fetch a group's avatar (base64 string).

Parameters:
Name Type Description
groupid string

The group ID

View Source infohub/UserGroup.js, line 734

  • The response object
Promise.<ApiResponse>

# async getGroupById(groupid, queryopt) → {Promise.<ApiResponse>}

Fetch a single group by ID.

Parameters:
Name Type Attributes Description
groupid string

The group ID

query object <optional>

The query parameters

filter string <optional>

The filter

members string <optional>

The members

View Source infohub/UserGroup.js, line 433

  • The response object
Promise.<ApiResponse>

# async getGroups(projectList, catalogueList, globalGroups, queryopt, withAvatar) → {Promise.<ApiResponse>}

List groups across projects, catalogues, and/or global scope.

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

The project ids

catalogueList Array.<string>

The catalogue ids

globalGroups boolean false

Whether to include global user groups

query object <optional>

The query parameters

filter string <optional>

The filter

members string <optional>

The members

withAvatar boolean

Whether to include the avatar of the groups

View Source infohub/UserGroup.js, line 651

  • The response object
Promise.<ApiResponse>

# async getGroupsInCatalogue(catalogueid, queryopt) → {Promise.<ApiResponse>}

List groups in a catalogue.

Parameters:
Name Type Attributes Description
catalogueid string

The catalogue ID

query object <optional>

The query parameters

filter string <optional>

The filter

members string <optional>

The members

View Source infohub/UserGroup.js, line 538

Promise.<ApiResponse>

# async getGroupsInProject(projectid, queryopt) → {Promise.<ApiResponse>}

List groups in a project.

Parameters:
Name Type Attributes Description
projectid string

The project ID

query object <optional>

The query parameters

filter string <optional>

The filter

members string <optional>

The members

View Source infohub/UserGroup.js, line 482

Promise.<ApiResponse>

# async inviteUserToGroup(groupid, dataopt) → {Promise.<ApiResponse>}

Invite a user to a group (creates a pending invitation).

Parameters:
Name Type Attributes Description
groupid string

The group ID

data object <optional>

Payload

parentid string <optional>

The parent ID

message string <optional>

The message

subject string <optional>

The subject

userrelations Array.<object> <optional>

The user relations of the group

userrelations[].userid string <optional>

The user ID

userrelations[].roles Array.<string> <optional>

The roles of the user

userrelations[].companyid string <optional>

The company ID

userrelations[].userconfig object <optional>

The user config

View Source infohub/UserGroup.js, line 399

  • The response object
Promise.<ApiResponse>

# async removeUserFromGroup(groupid, dataopt) → {Promise.<ApiResponse>}

Remove a user from a group.

Parameters:
Name Type Attributes Description
groupid string

The group ID

data object <optional>

Payload

userid string <optional>

The user ID

roleid string <optional>

The role ID

companyid string <optional>

The company ID

View Source infohub/UserGroup.js, line 350

  • The response object
Promise.<ApiResponse>

# async updateGroup(groupid, dataopt) → {Promise.<ApiResponse>}

Update an existing user group.

Parameters:
Name Type Attributes Description
groupid string

The group ID

data object <optional>

Group payload

name string <optional>

The name of the group

description string <optional>

The description of the group

permissions object <optional>

The permissions of the group

users Array.<string> <optional>

The users of the group

roles Array.<string> <optional>

The roles of the group

userrelations Array.<string> <optional>

The user relations of the group

invitations Array.<string> <optional>

The invitations of the group

View Source infohub/UserGroup.js, line 187

Promise.<ApiResponse>

# async updateGroupAvatar(groupid, avatar) → {Promise.<ApiResponse>}

Update a group's avatar (base64 string).

Parameters:
Name Type Description
groupid string

The group ID

avatar string

The avatar base64 string

View Source infohub/UserGroup.js, line 767

  • The response object
Promise.<ApiResponse>

# async updateUserInGroup(userrelationId, dataopt) → {Promise.<ApiResponse>}

Update a user's membership in a group.

Parameters:
Name Type Attributes Description
userrelationId string

The user relation ID

data object <optional>

Payload

userid string <optional>

The user ID

roles Array.<string> <optional>

The roles of the user

companyid string <optional>

The company ID

userconfig object <optional>

The user config

View Source infohub/UserGroup.js, line 305

  • The response object
Promise.<ApiResponse>