Only allow editors to access user comments page

This commit is contained in:
rubenwardy 2022-10-24 14:43:39 +01:00
parent 1ef71b7a59
commit da3af2c22f

@ -23,7 +23,7 @@ bp = Blueprint("threads", __name__)
from flask_login import current_user, login_required from flask_login import current_user, login_required
from app.models import * from app.models import *
from app.utils import addNotification, isYes, addAuditLog, get_system_user from app.utils import addNotification, isYes, addAuditLog, get_system_user, rank_required
from flask_wtf import FlaskForm from flask_wtf import FlaskForm
from wtforms import * from wtforms import *
from wtforms.validators import * from wtforms.validators import *
@ -373,6 +373,7 @@ def new():
@bp.route("/users/<username>/comments/") @bp.route("/users/<username>/comments/")
@rank_required(UserRank.EDITOR)
def user_comments(username): def user_comments(username):
user = User.query.filter_by(username=username).first() user = User.query.filter_by(username=username).first()
if user is None: if user is None: