Can toggle admin role

This commit is contained in:
2021-05-15 08:55:27 +02:00
parent 3ef0006c17
commit f38b4d663b
3 changed files with 95 additions and 4 deletions

View File

@ -23,4 +23,22 @@ export class AdminRolesHelper {
static async LoadRolesList() {
RolesList = await serverRequest("roles/list");
}
/**
* Toggle a role for an administrator
*
* @param adminID Target administrator ID
* @param role The role to toggle
*/
static async ToggleAdminRole(
adminID: number,
role: AdminRole,
enable: boolean
) {
await serverRequest("roles/toggle", {
adminID: adminID,
role: role.id,
enable: enable,
});
}
}