Adds permissions to templates

This commit is contained in:
Mouse Reeve 2020-10-01 13:09:37 -07:00
parent 9209039761
commit c396489dff
2 changed files with 6 additions and 4 deletions

View file

@ -9,7 +9,7 @@
<span>{% include 'snippets/book_titleby.html' with book=book %}</span>
</h2>
{% if request.user.is_authenticated %}
{% if request.user.is_authenticated and perms.bookwyrm.edit_book %}
<div class="level-right">
<a href="{{ book.id }}/edit">edit
<span class="icon icon-pencil">

View file

@ -70,12 +70,14 @@
<a href="/user-edit" class="navbar-item">
Settings
</a>
<a href="/invite" class="navbar-item">
Invites
</a>
<a href="/import" class="navbar-item">
Import books
</a>
{% if perms.bookwyrm.create_invites %}
<a href="/invite" class="navbar-item">
Invites
</a>
{% endif %}
<hr class="navbar-divider">
<a href="/logout" class="navbar-item">
Log out