From 6865ddcfd4c723bcc31142a7ac9b5f358771fb73 Mon Sep 17 00:00:00 2001 From: rebecca Date: Mon, 2 Nov 2026 22:58:25 +0000 Subject: require p_edit_wiki to create wiki pages --- apioforum/forum.py | 2 ++ apioforum/templates/edit_permissions.html | 2 +- apioforum/templates/view_forum.html | 4 +++- 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 @@

{% if has_permission(forum.id, g.user, "p_create_threads") %} create new thread -create new wiki page + {% if has_permission(forum.id, g.user, "p_edit_wiki") %} + create new wiki page + {% endif %} {% elif has_permission(forum.id, g.user, "p_create_threads", login_required=False) %} please log in to create a new thread {% else %} -- cgit v1.2.3