diff --git a/CHANGELOG.md b/CHANGELOG.md index a1bdbd52..02ea3d4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ 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) # v1.2.10 ## 1/30/2017 diff --git a/themes/grav/templates/user.html.twig b/themes/grav/templates/user.html.twig index 3cf3fc72..401f4720 100644 --- a/themes/grav/templates/user.html.twig +++ b/themes/grav/templates/user.html.twig @@ -4,27 +4,36 @@ {% set user = admin.data('users/' ~ admin.route) %} {% set title = "PLUGIN_ADMIN.USER"|tu ~ ": " ~ admin.route|e %} {% else %} - {% set title = "PLUGIN_ADMIN.USERS"|tu %} + {% set title = "PLUGIN_ADMIN_PRO.USERS"|tu %} {% endif %} {% block titlebar %} {% if not admin.route %} -
- {{ "PLUGIN_ADMIN.ADD_ACCOUNT"|tu }} -
-

{{ "PLUGIN_ADMIN.USERS"|tu }}

+ {% if authorize(['admin.users', 'admin.super']) %} +
+ {{ "PLUGIN_ADMIN.ADD_ACCOUNT"|tu }} +
+

{{ "PLUGIN_ADMIN.USERS"|tu }}

+ {% else %} +

{{ "PLUGIN_ADMIN.ACCESS_DENIED"|tu }}

+ {% endif %} {% else %} -
- {% if config.plugins["admin-pro"].enabled %} - {{ "PLUGIN_ADMIN.BACK"|tu }} - {% endif %} - -
-

{{ "PLUGIN_ADMIN.USER"|tu }}: {{ user.username|e }}

+ {% if authorize(['admin.users', 'admin.super']) or grav.user.username == user.username %} +
+ {% if config.plugins["admin-pro"].enabled %} + {{ "PLUGIN_ADMIN.BACK"|tu }} + {% endif %} + +
+

{{ "PLUGIN_ADMIN.USER"|tu }}: {{ user.username|e }}

+ {% else %} +

{{ "PLUGIN_ADMIN.ACCESS_DENIED"|tu }}

+ {% endif %} {% endif %} {% endblock %} {% block content %} + {% if authorize(['admin.users', 'admin.super']) or grav.user.username == user.username %}
{% if not admin.route %} {% include 'partials/users-list.html.twig' %} @@ -50,5 +59,6 @@
+ {% endif %} {% endblock %}