mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-04 01:55:10 +02:00
ability to remove user from org
This commit is contained in:
parent
2852d62258
commit
fadfaf1f0b
28 changed files with 718 additions and 264 deletions
|
@ -15,7 +15,7 @@ export async function ensureActions() {
|
|||
const defaultRoles = await db
|
||||
.select()
|
||||
.from(roles)
|
||||
.where(eq(roles.isSuperuserRole, true))
|
||||
.where(eq(roles.isSuperUserRole, true))
|
||||
.execute();
|
||||
|
||||
// Add new actions
|
||||
|
@ -38,15 +38,15 @@ export async function ensureActions() {
|
|||
}
|
||||
}
|
||||
|
||||
export async function createSuperuserRole(orgId: string) {
|
||||
export async function createSuperUserRole(orgId: string) {
|
||||
// Create the Default role if it doesn't exist
|
||||
const [insertedRole] = await db
|
||||
.insert(roles)
|
||||
.values({
|
||||
orgId,
|
||||
isSuperuserRole: true,
|
||||
name: 'Superuser',
|
||||
description: 'Superuser role with all actions'
|
||||
isSuperUserRole: true,
|
||||
name: 'Super User',
|
||||
description: 'Super User role with all actions'
|
||||
})
|
||||
.returning({ roleId: roles.roleId })
|
||||
.execute();
|
||||
|
@ -56,7 +56,7 @@ export async function createSuperuserRole(orgId: string) {
|
|||
const actionIds = await db.select().from(actions).execute();
|
||||
|
||||
if (actionIds.length === 0) {
|
||||
logger.info('No actions to assign to the Superuser role');
|
||||
logger.info('No actions to assign to the Super User role');
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ export const roles = sqliteTable("roles", {
|
|||
orgId: text("orgId").references(() => orgs.orgId, {
|
||||
onDelete: "cascade",
|
||||
}),
|
||||
isSuperuserRole: integer("isSuperuserRole", { mode: "boolean" }),
|
||||
isSuperUserRole: integer("isSuperUserRole", { mode: "boolean" }),
|
||||
name: text("name").notNull(),
|
||||
description: text("description"),
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue