mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-03 00:06:46 +01:00
Update user default permissions
This commit is contained in:
parent
790c1fb34a
commit
47712e63f1
@ -270,7 +270,7 @@ class UserController {
|
|||||||
const permissions = {
|
const permissions = {
|
||||||
...user.permissions
|
...user.permissions
|
||||||
}
|
}
|
||||||
const defaultPermissions = Database.userModel.getDefaultPermissionsForUserType(updatePayload.type || 'user')
|
const defaultPermissions = Database.userModel.getDefaultPermissionsForUserType(updatePayload.type || user.type || 'user')
|
||||||
for (const key in updatePayload.permissions) {
|
for (const key in updatePayload.permissions) {
|
||||||
// Check that the key is a valid permission key or is included in the default permissions
|
// Check that the key is a valid permission key or is included in the default permissions
|
||||||
if (permissions[key] !== undefined || defaultPermissions[key] !== undefined) {
|
if (permissions[key] !== undefined || defaultPermissions[key] !== undefined) {
|
||||||
|
Loading…
Reference in New Issue
Block a user