mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-09 20:29:36 +02:00
Fix album permissions by role
This commit is contained in:
@@ -20,14 +20,22 @@ const checkServerPermissions = (
|
||||
|
||||
const checkServerFolderPermissions = (
|
||||
user: AuthUser,
|
||||
options: { serverFolderId?: string[] | string }
|
||||
options: { serverFolderId?: string[] | string; serverId: string }
|
||||
) => {
|
||||
const { serverFolderId } = options;
|
||||
const { serverFolderId, serverId } = options;
|
||||
|
||||
if (user.isAdmin || !serverFolderId) {
|
||||
return;
|
||||
}
|
||||
|
||||
const isServerAdmin =
|
||||
user.serverPermissions.find((s) => s.serverId === serverId)?.type ===
|
||||
ServerPermissionType.ADMIN;
|
||||
|
||||
if (isServerAdmin) {
|
||||
return;
|
||||
}
|
||||
|
||||
let ids: string[] = [];
|
||||
if (typeof serverFolderId === 'string') {
|
||||
ids = [serverFolderId];
|
||||
|
||||
Reference in New Issue
Block a user