Update user default permissions

This commit is contained in:
advplyr 2024-09-02 15:55:25 -05:00
parent 790c1fb34a
commit 47712e63f1

View File

@ -270,7 +270,7 @@ class UserController {
const 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) {
// Check that the key is a valid permission key or is included in the default permissions
if (permissions[key] !== undefined || defaultPermissions[key] !== undefined) {