From 76ba56f6564fd0fde4449dc30bbd7baeb832851f Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sun, 29 Aug 2021 08:14:53 -0700 Subject: [PATCH] Fixes admin permissions --- bookwyrm/templates/layout.html | 6 +++--- bookwyrm/templates/settings/admin_layout.html | 6 ++++++ bookwyrm/views/user_admin.py | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/bookwyrm/templates/layout.html b/bookwyrm/templates/layout.html index 2b8364ec..43ca81c7 100644 --- a/bookwyrm/templates/layout.html +++ b/bookwyrm/templates/layout.html @@ -109,17 +109,17 @@ {% trans 'Settings' %} - {% if perms.bookwyrm.create_invites or perms.moderate_users %} + {% if perms.bookwyrm.create_invites or perms.moderate_user %} {% endif %} - {% if perms.bookwyrm.create_invites %} + {% if perms.bookwyrm.create_invites and not site.allow_registration %}
  • {% trans 'Invites' %}
  • {% endif %} - {% if perms.bookwyrm.moderate_users %} + {% if perms.bookwyrm.moderate_user %}
  • {% trans 'Admin' %} diff --git a/bookwyrm/templates/settings/admin_layout.html b/bookwyrm/templates/settings/admin_layout.html index 9e57076b..6d651647 100644 --- a/bookwyrm/templates/settings/admin_layout.html +++ b/bookwyrm/templates/settings/admin_layout.html @@ -21,23 +21,29 @@ {% if perms.bookwyrm.create_invites %} {% endif %} {% if perms.bookwyrm.edit_instance_settings %} diff --git a/bookwyrm/views/user_admin.py b/bookwyrm/views/user_admin.py index 7cfefb0f..3a9ea339 100644 --- a/bookwyrm/views/user_admin.py +++ b/bookwyrm/views/user_admin.py @@ -13,7 +13,7 @@ from bookwyrm.settings import PAGE_LENGTH # pylint: disable= no-self-use @method_decorator(login_required, name="dispatch") @method_decorator( - permission_required("bookwyrm.moderate_users", raise_exception=True), + permission_required("bookwyrm.moderate_user", raise_exception=True), name="dispatch", ) class UserAdminList(View):