mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-16 08:24:16 +02:00
Add isSuperAdmin account
This commit is contained in:
@@ -603,6 +603,7 @@ const users = (
|
|||||||
refreshToken: item.refreshToken,
|
refreshToken: item.refreshToken,
|
||||||
enabled: item.enabled,
|
enabled: item.enabled,
|
||||||
isAdmin: item.isAdmin,
|
isAdmin: item.isAdmin,
|
||||||
|
isSuperAdmin: item.isSuperAdmin,
|
||||||
deviceId: item.deviceId,
|
deviceId: item.deviceId,
|
||||||
createdAt: item.createdAt,
|
createdAt: item.createdAt,
|
||||||
updatedAt: item.updatedAt,
|
updatedAt: item.updatedAt,
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ export const authenticate = (
|
|||||||
flatServerPermissions,
|
flatServerPermissions,
|
||||||
id: user?.id,
|
id: user?.id,
|
||||||
isAdmin: user?.isAdmin,
|
isAdmin: user?.isAdmin,
|
||||||
|
isSuperAdmin: user?.isSuperAdmin,
|
||||||
server: req.params.serverId,
|
server: req.params.serverId,
|
||||||
serverFolderPermissions: user?.serverFolderPermissions,
|
serverFolderPermissions: user?.serverFolderPermissions,
|
||||||
serverPermissions: user?.serverPermissions,
|
serverPermissions: user?.serverPermissions,
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "User" ADD COLUMN "isSuperAdmin" BOOLEAN NOT NULL DEFAULT false;
|
||||||
@@ -57,15 +57,16 @@ model RefreshToken {
|
|||||||
}
|
}
|
||||||
|
|
||||||
model User {
|
model User {
|
||||||
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
||||||
displayName String? @unique
|
displayName String? @unique
|
||||||
username String @unique
|
username String @unique
|
||||||
password String
|
password String
|
||||||
enabled Boolean @default(false)
|
enabled Boolean @default(false)
|
||||||
isAdmin Boolean @default(false)
|
isAdmin Boolean @default(false)
|
||||||
deviceId String @unique
|
isSuperAdmin Boolean @default(false)
|
||||||
createdAt DateTime @default(now())
|
deviceId String @unique
|
||||||
updatedAt DateTime @updatedAt
|
createdAt DateTime @default(now())
|
||||||
|
updatedAt DateTime @updatedAt
|
||||||
|
|
||||||
histories History[]
|
histories History[]
|
||||||
albumArtistRatings AlbumArtistRating[]
|
albumArtistRatings AlbumArtistRating[]
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ async function main() {
|
|||||||
deviceId: `admin_${randomString(10)}`,
|
deviceId: `admin_${randomString(10)}`,
|
||||||
enabled: true,
|
enabled: true,
|
||||||
isAdmin: true,
|
isAdmin: true,
|
||||||
|
isSuperAdmin: true,
|
||||||
password: hashedPassword,
|
password: hashedPassword,
|
||||||
username: 'admin',
|
username: 'admin',
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user