diff --git a/app/models.py b/app/models.py
index c703783e..c402d098 100644
--- a/app/models.py
+++ b/app/models.py
@@ -85,9 +85,10 @@ class Permission(enum.Enum):
return False
if self == Permission.APPROVE_NEW or \
- self == Permission.APPROVE_CHANGES or \
- self == Permission.APPROVE_RELEASE or \
- self == Permission.APPROVE_SCREENSHOT:
+ self == Permission.APPROVE_CHANGES or \
+ self == Permission.APPROVE_RELEASE or \
+ self == Permission.APPROVE_SCREENSHOT or \
+ self == Permission.SEE_THREAD:
return user.rank.atLeast(UserRank.EDITOR)
else:
raise Exception("Non-global permission checked globally. Use Package.checkPerm or User.checkPerm instead.")
diff --git a/app/templates/macros/threads.html b/app/templates/macros/threads.html
index b74edda1..6552f2ad 100644
--- a/app/templates/macros/threads.html
+++ b/app/templates/macros/threads.html
@@ -29,6 +29,8 @@
{% for t in threads %}
- {{ t.title }} by {{ t.author.display_name }}
+ {% else %}
+ - No threads found
{% endfor %}
{% endmacro %}
diff --git a/app/views/packages/__init__.py b/app/views/packages/__init__.py
index 61848130..a4f7a045 100644
--- a/app/views/packages/__init__.py
+++ b/app/views/packages/__init__.py
@@ -37,11 +37,11 @@ def build_packages_query():
type = PackageType[type_name.upper()]
title = "Packages"
- query = Package.query.filter_by(soft_deleted=False)
+ query = Package.query.filter_by(soft_deleted=False, approved=True)
if type is not None:
title = type.value + "s"
- query = query.filter_by(type=type, approved=True)
+ query = query.filter_by(type=type)
search = request.args.get("q")
if search is not None and search.strip() != "":
diff --git a/app/views/threads.py b/app/views/threads.py
index a842d585..2aa815e8 100644
--- a/app/views/threads.py
+++ b/app/views/threads.py
@@ -27,8 +27,10 @@ from wtforms.validators import *
@app.route("/threads/")
def threads_page():
- threads = Thread.query.filter_by(private=False).all()
- return render_template("threads/list.html", threads=threads)
+ query = Thread.query
+ if not Permission.SEE_THREAD.check(current_user):
+ query = query.filter_by(private=False)
+ return render_template("threads/list.html", threads=query.all())
@app.route("/threads//", methods=["GET", "POST"])
def thread_page(id):