mirror of
https://github.com/fosrl/pangolin.git
synced 2026-01-29 06:10:47 +00:00
🚧 wip: approval tables in DB
This commit is contained in:
@@ -307,7 +307,11 @@ export const approvals = pgTable("approvals", {
|
||||
.notNull(),
|
||||
olmId: varchar("olmId").references(() => olms.olmId, {
|
||||
onDelete: "cascade"
|
||||
}), // olms reference user devices clients
|
||||
}), // olms reference user devices clients (in this case)
|
||||
userId: varchar("userId").references(() => users.userId, {
|
||||
// optionally tied to a user and in this case delete when the user deletes
|
||||
onDelete: "cascade"
|
||||
}),
|
||||
decision: varchar("type")
|
||||
.$type<"approved" | "denied" | "pending">()
|
||||
.default("pending")
|
||||
|
||||
@@ -355,7 +355,8 @@ export const roles = pgTable("roles", {
|
||||
.notNull(),
|
||||
isAdmin: boolean("isAdmin"),
|
||||
name: varchar("name").notNull(),
|
||||
description: varchar("description")
|
||||
description: varchar("description"),
|
||||
requireDeviceApproval: boolean("requireDeviceApproval").default(false)
|
||||
});
|
||||
|
||||
export const roleActions = pgTable("roleActions", {
|
||||
@@ -699,7 +700,10 @@ export const olms = pgTable("olms", {
|
||||
userId: text("userId").references(() => users.userId, {
|
||||
// optionally tied to a user and in this case delete when the user deletes
|
||||
onDelete: "cascade"
|
||||
})
|
||||
}),
|
||||
authorizationState: varchar("authorizationState")
|
||||
.$type<"pending" | "authorized" | "denied">()
|
||||
.default("authorized")
|
||||
});
|
||||
|
||||
export const olmSessions = pgTable("clientSession", {
|
||||
|
||||
@@ -503,7 +503,10 @@ export const roles = sqliteTable("roles", {
|
||||
.notNull(),
|
||||
isAdmin: integer("isAdmin", { mode: "boolean" }),
|
||||
name: text("name").notNull(),
|
||||
description: text("description")
|
||||
description: text("description"),
|
||||
requireDeviceApproval: integer("requireDeviceApproval", {
|
||||
mode: "boolean"
|
||||
}).default(false)
|
||||
});
|
||||
|
||||
export const roleActions = sqliteTable("roleActions", {
|
||||
|
||||
Reference in New Issue
Block a user