Skip to content

Commit

Permalink
Allow plugin to set custom 'authorize' and 'location' in `onAdminMenu…
Browse files Browse the repository at this point in the history
…()` event
  • Loading branch information
mahagr committed Feb 2, 2017
1 parent 0139288 commit b580e86
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# v1.2.11
## xx/xx/2017

1. [](#improved)
* Allow plugin to set custom 'authorize' and 'location' in `onAdminMenu()` event
1. [](#bugfix)
* Fixed issue `admin.super` or `admin.users` users changing the account when saving another user [#713](https://github.com/getgrav/grav-plugin-admin/issues/713)
* Fix issue where non `admin.super`/`admin.users` users could see other users profiles [#713](https://github.com/getgrav/grav-plugin-admin/issues/713)
Expand Down
6 changes: 3 additions & 3 deletions themes/grav/templates/partials/nav.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
{% endif %}
{% if grav.twig.plugins_hooked_nav %}
{% for label, item in grav.twig.plugins_hooked_nav %}
{% if authorize(['admin.' ~ item.route, 'admin.super']) %}
<li class="{{ (location == item.route) ? 'selected' : '' }}">
<a href="{{ base_url_relative }}/{{ item.route }}">
{% if authorize([item.authorize ?: ('admin.' ~ (item.location ?: item.route)), 'admin.super']) %}
<li class="{{ (location == (item.location ?: item.route)) ? 'selected' : '' }}">
<a href="{{ base_url_relative }}/{{ item.route ?: item.location }}">
<i class="fa fa-fw {{ item.icon }}"></i>
<em>{{ label|tu }}</em>
</a>
Expand Down

0 comments on commit b580e86

Please sign in to comment.