Skip to content

Commit

Permalink
fix(plugins): do not show menu item for editors
Browse files Browse the repository at this point in the history
  • Loading branch information
thejoeejoee committed Nov 11, 2023
1 parent c7eadb9 commit cb51ce7
Showing 1 changed file with 27 additions and 18 deletions.
45 changes: 27 additions & 18 deletions fiesta/apps/sections/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,33 @@ def as_navigation_item(self, request: HttpRequest, bound_plugin: Plugin) -> Navi
.as_navigation_item(request, bound_plugin)
._replace(
url="",
children=[
NavigationItemSpec(
_("Members"),
reverse("sections:section-members"),
),
NavigationItemSpec(
_("Internationals"),
reverse("sections:section-internationals"),
),
NavigationItemSpec(
_("Statistics"),
reverse("sections:section-stats"),
),
NavigationItemSpec(
_("Plugins"),
reverse("sections:section-plugins"),
),
],
children=list(
filter(
None,
[
NavigationItemSpec(
_("Members"),
reverse("sections:section-members"),
),
NavigationItemSpec(
_("Internationals"),
reverse("sections:section-internationals"),
),
NavigationItemSpec(
_("Statistics"),
reverse("sections:section-stats"),
),
(
NavigationItemSpec(
_("Plugins"),
reverse("sections:section-plugins"),
)
if request.membership.is_section_admin
else None
),
],
)
),
)
)

Expand Down

0 comments on commit cb51ce7

Please sign in to comment.