🐛 Fixed admin loading member counts for authors and editors

no issue

When using admin as a user with author or editor permissions, admin tried to load the member counts in order to display them in the menu. But authors and editors are not allowed to see the members. So the request returned a 403.

It is not necessary to load the member counts for authors and editors, so we can just skip the request.
This commit is contained in:
Simon Backx 2023-01-05 16:37:01 +01:00
parent cf5c64f96b
commit d34f07f408

View File

@ -71,7 +71,10 @@ export default class Main extends Component.extend(ShortcutsMixin) {
didReceiveAttrs() {
super.didReceiveAttrs(...arguments);
this._setIconStyle();
this._loadMemberCountsTask.perform();
if (this.session.user && this.session.user.isAdmin) {
this._loadMemberCountsTask.perform();
}
}
didInsertElement() {