mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
🐛 Fixed limits not allowing contributors to be unsuspended
refs https://github.com/TryGhost/Team/issues/510 - contributors don't count towards the staff limit, therefore they should be allowed to be unsuspended - currently, we don't check the role when unsuspending, which is incorrect - this bug is pure oversight!
This commit is contained in:
parent
0242e5e48b
commit
2996180c60
1 changed files with 4 additions and 2 deletions
|
@ -710,8 +710,10 @@ User = ghostBookshelf.Model.extend({
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we have a staff user limit & the user is being unsuspended
|
const isUnsuspending = unsafeAttrs.status && unsafeAttrs.status === 'active' && userModel.get('status') === 'inactive';
|
||||||
if (limitService.isLimited('staff') && action === 'edit' && unsafeAttrs.status && unsafeAttrs.status === 'active' && userModel.get('status') === 'inactive') {
|
|
||||||
|
// If we have a staff user limit & the staff user is being unsuspended (don't count contributors)
|
||||||
|
if (limitService.isLimited('staff') && action === 'edit' && isUnsuspending && !userModel.hasRole('Contributor')) {
|
||||||
await limitService.errorIfWouldGoOverLimit('staff');
|
await limitService.errorIfWouldGoOverLimit('staff');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue