mirror of
https://github.com/jeffvli/feishin.git
synced 2024-11-20 14:37:06 +01:00
Add isSuperAdmin account
This commit is contained in:
parent
3bc0ea16bc
commit
df8e38cedd
@ -603,6 +603,7 @@ const users = (
|
||||
refreshToken: item.refreshToken,
|
||||
enabled: item.enabled,
|
||||
isAdmin: item.isAdmin,
|
||||
isSuperAdmin: item.isSuperAdmin,
|
||||
deviceId: item.deviceId,
|
||||
createdAt: item.createdAt,
|
||||
updatedAt: item.updatedAt,
|
||||
|
@ -57,6 +57,7 @@ export const authenticate = (
|
||||
flatServerPermissions,
|
||||
id: user?.id,
|
||||
isAdmin: user?.isAdmin,
|
||||
isSuperAdmin: user?.isSuperAdmin,
|
||||
server: req.params.serverId,
|
||||
serverFolderPermissions: user?.serverFolderPermissions,
|
||||
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 {
|
||||
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
||||
displayName String? @unique
|
||||
username String @unique
|
||||
password String
|
||||
enabled Boolean @default(false)
|
||||
isAdmin Boolean @default(false)
|
||||
deviceId String @unique
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
||||
displayName String? @unique
|
||||
username String @unique
|
||||
password String
|
||||
enabled Boolean @default(false)
|
||||
isAdmin Boolean @default(false)
|
||||
isSuperAdmin Boolean @default(false)
|
||||
deviceId String @unique
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
histories History[]
|
||||
albumArtistRatings AlbumArtistRating[]
|
||||
|
@ -15,6 +15,7 @@ async function main() {
|
||||
deviceId: `admin_${randomString(10)}`,
|
||||
enabled: true,
|
||||
isAdmin: true,
|
||||
isSuperAdmin: true,
|
||||
password: hashedPassword,
|
||||
username: 'admin',
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user