diff options
author | rubenwardy <rw@rubenwardy.com> | 2018-12-25 17:58:44 +0000 |
---|---|---|
committer | rubenwardy <rw@rubenwardy.com> | 2018-12-25 17:58:44 +0000 |
commit | f5744f518885eae03d44675ce6a122fa1d1476ce (patch) | |
tree | c92e503d9730ae35a1c82f8b578281dc9c4c6e51 /app | |
parent | 272be09ba13fa8371ee00cbaa23a19b254f4d669 (diff) | |
download | cheatdb-f5744f518885eae03d44675ce6a122fa1d1476ce.tar.xz |
Fix non-editors seeing create buttons for topics
Diffstat (limited to 'app')
-rw-r--r-- | app/templates/macros/topics.html | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/templates/macros/topics.html b/app/templates/macros/topics.html index 432867d..7048f96 100644 --- a/app/templates/macros/topics.html +++ b/app/templates/macros/topics.html @@ -23,10 +23,12 @@ <td>{{ topic.name or ""}}</td> <td>{{ topic.created_at | date }}</td> <td class="btn-group"> - <a class="btn btn-primary" - href="{{ url_for('create_edit_package_page', author=topic.author.username, repo=topic.getRepoURL(), forums=topic.topic_id, title=topic.title, bname=topic.name) }}"> - Create - </a> + {% if topic.author.checkPerm(current_user, "CHANGE_AUTHOR") %} + <a class="btn btn-primary" + href="{{ url_for('create_edit_package_page', author=topic.author.username, repo=topic.getRepoURL(), forums=topic.topic_id, title=topic.title, bname=topic.name) }}"> + Create + </a> + {% endif %} {% if show_discard and current_user.is_authenticated and topic.checkPerm(current_user, "TOPIC_DISCARD") %} <a class="btn btn-{% if topic.discarded %}success{% else %}danger{% endif %} topic-discard" data-tid={{ topic.topic_id }}> {% if topic.discarded %} |