mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-16 01:46:38 +00:00
Trying to add site provider
This commit is contained in:
@@ -54,13 +54,14 @@ export async function createSuperuserRole(orgId: number) {
|
||||
|
||||
const roleId = insertedRole.roleId;
|
||||
|
||||
// Add all current actions to the new Default role
|
||||
const actionIds = Object.values(ActionsEnum);
|
||||
const actionIds = await db.select().from(actions).execute();
|
||||
|
||||
if (actionIds.length === 0) {
|
||||
logger.info('No actions to assign to the Superuser role');
|
||||
return;
|
||||
}
|
||||
|
||||
await db.insert(roleActions)
|
||||
.values(actionIds.map(actionId => ({
|
||||
roleId,
|
||||
actionId: actionId,
|
||||
orgId
|
||||
})))
|
||||
.values(actionIds.map(action => ({ roleId, actionId: action.actionId, orgId })))
|
||||
.execute();
|
||||
}
|
||||
Reference in New Issue
Block a user