mirror of
https://github.com/biersoeckli/QuickStack.git
synced 2026-02-11 05:59:23 -06:00
feat: add new role permissions for app creation and backup access, update related models and utilities
This commit is contained in:
18
prisma/migrations/20250307150516_migration/migration.sql
Normal file
18
prisma/migrations/20250307150516_migration/migration.sql
Normal file
@@ -0,0 +1,18 @@
|
||||
-- RedefineTables
|
||||
PRAGMA defer_foreign_keys=ON;
|
||||
PRAGMA foreign_keys=OFF;
|
||||
CREATE TABLE "new_Role" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"name" TEXT NOT NULL,
|
||||
"description" TEXT,
|
||||
"canCreateNewApps" BOOLEAN NOT NULL DEFAULT false,
|
||||
"canAccessBackups" BOOLEAN NOT NULL DEFAULT false,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" DATETIME NOT NULL
|
||||
);
|
||||
INSERT INTO "new_Role" ("createdAt", "description", "id", "name", "updatedAt") SELECT "createdAt", "description", "id", "name", "updatedAt" FROM "Role";
|
||||
DROP TABLE "Role";
|
||||
ALTER TABLE "new_Role" RENAME TO "Role";
|
||||
CREATE UNIQUE INDEX "Role_name_key" ON "Role"("name");
|
||||
PRAGMA foreign_keys=ON;
|
||||
PRAGMA defer_foreign_keys=OFF;
|
||||
@@ -118,14 +118,13 @@ model Authenticator {
|
||||
// *** FROM HERE CUSTOM CLASSES
|
||||
|
||||
model Role {
|
||||
id String @id @default(uuid())
|
||||
name String @unique
|
||||
description String?
|
||||
id String @id @default(uuid())
|
||||
name String @unique
|
||||
description String?
|
||||
canCreateNewApps Boolean @default(false)
|
||||
canAccessBackups Boolean @default(false)
|
||||
|
||||
// A Role can be assigned to multiple users
|
||||
users User[]
|
||||
|
||||
// A Role defines permissions on apps via the join model below
|
||||
users User[]
|
||||
roleAppPermissions RoleAppPermission[]
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
Reference in New Issue
Block a user