aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--apioforum/forum.py2
-rw-r--r--apioforum/templates/edit_permissions.html2
-rw-r--r--apioforum/templates/view_forum.html4
3 files changed, 6 insertions, 2 deletions
diff --git a/apioforum/forum.py b/apioforum/forum.py
index 500b1f5..0de45ee 100644
--- a/apioforum/forum.py
+++ b/apioforum/forum.py
@@ -312,6 +312,8 @@ def create_thread(forum):
""",(wiki_path,forum['id'])).fetchone()
if existing:
err = "there's already a page with that name"
+ if not has_permission(forum['id'], g.user, "p_edit_wiki"):
+ err = "you do not have permission to create wiki pages"
if err is None:
lock = int(request.form.get('lock','0'))
diff --git a/apioforum/templates/edit_permissions.html b/apioforum/templates/edit_permissions.html
index 3903048..3fadfe7 100644
--- a/apioforum/templates/edit_permissions.html
+++ b/apioforum/templates/edit_permissions.html
@@ -46,7 +46,7 @@
{{perm("p_vote","vote",
"allow users with the role to vote in polls")}}
{{perm("p_edit_wiki","edit wiki",
- "edit the content of wiki pages")}}
+ "create and edit the content of wiki pages")}}
{{perm("p_create_subforum","create subforæ",
"allow users with the role to create subforæ in this forum. " +
"they will automatically become a bureaucrat in this subforum.")}}
diff --git a/apioforum/templates/view_forum.html b/apioforum/templates/view_forum.html
index 2e1fb0d..b2afc03 100644
--- a/apioforum/templates/view_forum.html
+++ b/apioforum/templates/view_forum.html
@@ -46,7 +46,9 @@
<p>
{% if has_permission(forum.id, g.user, "p_create_threads") %}
<a class="actionbutton" href="{{url_for('forum.create_thread',forum_id=forum.id)}}">create new thread</a>
-<a class="actionbutton" href="{{url_for('forum.create_thread',forum_id=forum.id)}}?type=wiki_page">create new wiki page</a>
+ {% if has_permission(forum.id, g.user, "p_edit_wiki") %}
+ <a class="actionbutton" href="{{url_for('forum.create_thread',forum_id=forum.id)}}?type=wiki_page">create new wiki page</a>
+ {% endif %}
{% elif has_permission(forum.id, g.user, "p_create_threads", login_required=False) %}
please log in to create a new thread
{% else %}