mirror of
https://github.com/discourse/discourse-data-explorer.git
synced 2025-06-29 19:12:11 +00:00
Allow admins to see the group reports nav item (#101)
Previously, the report tab would appear only if the user was a member of the group. With this change, admins can see the reports in any group.
This commit is contained in:
parent
cc69d28229
commit
82cb3ac2fe
@ -13,9 +13,12 @@ export default Ember.Component.extend({
|
|||||||
init(args) {
|
init(args) {
|
||||||
this.set("group", args.group);
|
this.set("group", args.group);
|
||||||
if (
|
if (
|
||||||
(this.get("currentUser.groups") || []).some((g) => g.id === this.group.id)
|
(this.get("currentUser.groups") || []).some(
|
||||||
|
(g) => g.id === this.group.id
|
||||||
|
) ||
|
||||||
|
this.get("currentUser.admin")
|
||||||
) {
|
) {
|
||||||
// User is a part of the group. Now check if the group has reports
|
// User is a part of the group (or an admin). Now check if the group has reports
|
||||||
this.checkForReports();
|
this.checkForReports();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user