Only show themes to sys admin

This commit is contained in:
Mouse Reeve 2022-12-05 17:11:15 -08:00
parent a2874bf460
commit 845bd2cc0d
2 changed files with 4 additions and 2 deletions

View file

@ -110,10 +110,12 @@
<a href="{{ url }}"{% if url in request.path %} class="is-active" aria-selected="true"{% endif %}>{% trans "Registration" %}</a>
{% endif %}
</li>
{% if perms.bookwyrm.system_administration %}
<li>
{% url 'settings-themes' as url %}
<a href="{{ url }}"{% if url in request.path %} class="is-active" aria-selected="true"{% endif %}>{% trans "Themes" %}</a>
</li>
{% endif %}
</ul>
{% endif %}
</nav>

View file

@ -12,7 +12,7 @@ from bookwyrm import forms, models
# pylint: disable= no-self-use
@method_decorator(login_required, name="dispatch")
@method_decorator(
permission_required("bookwyrm.edit_instance_settings", raise_exception=True),
permission_required("bookwyrm.system_administration", raise_exception=True),
name="dispatch",
)
class Themes(View):
@ -46,7 +46,7 @@ def get_view_data():
@require_POST
@permission_required("bookwyrm.edit_instance_settings", raise_exception=True)
@permission_required("bookwyrm.system_administration", raise_exception=True)
# pylint: disable=unused-argument
def delete_theme(request, theme_id):
"""Remove a theme"""