skipcheck

TM1 client · Docs · Security

GroupService

import { GroupService } from "@skipcheck/tm1-client";

Security groups: /Groups and their users. A user's membership is set from the user's side, with UserService.setGroups.

List a group's members:

const users = await tm1.groups.users("Planners", ODataQuery.none().select(User.Fields.Name)).toArray();
return users.map((user) => user.Name!);

Create a group and add a user to it, from the user's side:

// A new group, then alice added to it, from her side: her groups plus this one
await tm1.groups.create("Planners");
const groups = await tm1.users.groups("alice", ODataQuery.none().select(Group.Fields.Name)).toArray();
await tm1.users.setGroups("alice", [...groups.map((group) => group.Name!), "Planners"]);

Members

listGET Groups, streamed.
getThe group, or a Tm1NotFoundException if there's none.
createCreates an empty group; returns it as created.
deleteDeletes the group; its users stay, without it.
usersGET Groups('name')/Users, streamed.

list

list(query?: ODataQuery | null, options?: Tm1CallOptions): Tm1Stream<Group>

GET Groups, streamed.

TM1 REST EntitySet Groups

get

get(name: string, query?: ODataQuery | null, options?: Tm1CallOptions): Promise<Group>

GET Groups('name'): the group, or a Tm1NotFoundException if there's none.

TM1 REST EntitySet Groups

create

create(name: string, options?: Tm1CallOptions): Promise<Group>

POST Groups: creates an empty group; returns it as created.

TM1 REST EntitySet Groups

delete

delete(name: string, options?: Tm1CallOptions): Promise<void>

DELETE Groups('name'): deletes the group; its users stay, without it.

TM1 REST EntitySet Groups

users

users(name: string, query?: ODataQuery | null, options?: Tm1CallOptions): Tm1Stream<User>

GET Groups('name')/Users, streamed.

TM1 REST Navigation Group/Users