mirror of
https://github.com/sct/overseerr.git
synced 2025-09-17 17:24:35 +02:00
fix: add correct permission checks to modifying user password/permissions
This commit is contained in:
@@ -167,7 +167,10 @@ router.get<{ id: string }, UserRequestsResponse>(
|
||||
}
|
||||
);
|
||||
|
||||
const canMakePermissionsChange = (permissions: number, user?: User) =>
|
||||
export const canMakePermissionsChange = (
|
||||
permissions: number,
|
||||
user?: User
|
||||
): boolean =>
|
||||
// Only let the owner grant admin privileges
|
||||
!(hasPermission(Permission.ADMIN, permissions) && user?.id !== 1) ||
|
||||
// Only let users with the manage settings permission, grant the same permission
|
||||
|
Reference in New Issue
Block a user