dev: add group management SDK

This commit is contained in:
KernelDeimos
2025-03-05 15:24:52 -05:00
parent 7aa3cb7312
commit 53c865c973
+22
View File
@@ -68,4 +68,26 @@ export default class Perms {
origin, permission,
})
}
// Group Management
async createGroup (metadata = {}, extra = {}) {
return await this.req_('/group/create', {
metadata, extra,
});
}
async addUsersToGroup (uid, usernames) {
return await this.req_('/group/add-users', {
uid,
users: usernames ?? [],
});
}
async removeUsersFromGroup (uid, usernames) {
return await this.req_('/group/remove-users', {
uid,
users: usernames ?? [],
});
}
async listGroups () {
return await this.req_('/group/list');
}
}