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:
parent
fc30aebd21
commit
8756ddac53
1 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue