From a2b826cd22da82982c5b104ede1408e5d736c9e6 Mon Sep 17 00:00:00 2001 From: fireworks88 Date: Thu, 29 Jul 2021 00:11:18 +0200 Subject: [PATCH] sneed --- drama/routes/admin.py | 4 ++-- drama/routes/comments.py | 2 +- drama/templates/comments.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drama/routes/admin.py b/drama/routes/admin.py index a1f5eb432..1b58c8664 100644 --- a/drama/routes/admin.py +++ b/drama/routes/admin.py @@ -633,7 +633,7 @@ def ban_user(user_id, v): user = g.db.query(User).filter_by(id=user_id).first() - if user.admin_level != 0: abort(403) + if user.admin_level >= v.admin_level: abort(403) # check for number of days for suspension days = int(request.form.get("days")) if request.form.get('days') else 0 @@ -642,7 +642,7 @@ def ban_user(user_id, v): if not user: abort(400) - if user.admin_level > 0: abort(403) + #if user.admin_level > 0: abort(403) if days > 0: if message: diff --git a/drama/routes/comments.py b/drama/routes/comments.py index 8d9a83dbe..cb7f93f6d 100644 --- a/drama/routes/comments.py +++ b/drama/routes/comments.py @@ -920,7 +920,7 @@ def toggle_comment_pin(cid, v): comment = get_comment(cid, v=v) - if v.admin_level != 6 and v.id != comment.post.author_id: + if v.admin_level < 1 and v.id != comment.post.author_id: abort(403) comment.is_pinned = not comment.is_pinned diff --git a/drama/templates/comments.html b/drama/templates/comments.html index 037be7cc9..96ca0b8ee 100644 --- a/drama/templates/comments.html +++ b/drama/templates/comments.html @@ -336,7 +336,7 @@ {% endif %} {% endif %} - {% if v and c.post and (v.admin_level == 6 or v.id == c.post.author_id) %} + {% if v and c.post and (v.admin_level >= 1 or v.id == c.post.author_id) %} {% if c.level == 1 %} {{"Unpin" if c.is_pinned else "Pin"}}