0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Fixed staff limit check to filter out "Contributors"

refs https://github.com/TryGhost/Team/issues/587

- Invites and users with "Contributor" roles should not be counted towards the limit
This commit is contained in:
Naz 2021-04-08 21:10:59 +12:00
parent fc30aebd21
commit 8756ddac53

View file

@ -74,9 +74,10 @@ export default class LimitsService extends Service {
users: this.store.findAll('user', {reload: true}),
invites: this.store.findAll('invite', {reload: true})
}).then((data) => {
const activeUsers = data.users.filter(u => u.status !== 'inactive');
const staffUsers = data.users.filter(u => u.get('status') !== 'inactive' && u.role.get('name') !== 'Contributor');
const staffInvites = data.invites.filter(i => i.role.get('name') !== 'Contributor');
return activeUsers.length + data.invites.length;
return staffUsers.length + staffInvites.length;
});
}