Allow editors to see reports
Some reports are about packages and not users
This commit is contained in:
@@ -116,7 +116,7 @@ def report_received():
|
||||
|
||||
|
||||
@bp.route("/admin/reports/")
|
||||
@rank_required(UserRank.MODERATOR)
|
||||
@rank_required(UserRank.EDITOR)
|
||||
def list_all():
|
||||
reports = Report.query.order_by(db.asc(Report.is_resolved), db.asc(Report.created_at)).all()
|
||||
return render_template("report/list.html", reports=reports)
|
||||
|
||||
@@ -212,7 +212,7 @@ class Report(db.Model):
|
||||
return False
|
||||
|
||||
if perm == Permission.SEE_REPORT:
|
||||
return user.rank.at_least(UserRank.MODERATOR)
|
||||
return user.rank.at_least(UserRank.EDITOR)
|
||||
else:
|
||||
raise Exception("Permission {} is not related to reports".format(perm.name))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user