work in progress, add fidelity to category group permissions (full, create posts, readonly)

This commit is contained in:
Sam
2013-07-14 11:24:16 +10:00
parent 8d947535a8
commit ecf17cfebb
38 changed files with 349 additions and 126 deletions

View File

@ -103,9 +103,9 @@ class Topic < ActiveRecord::Base
# Query conditions
condition =
if ids.present?
["NOT c.secure or c.id in (:cats)", cats: ids]
["NOT c.read_restricted or c.id in (:cats)", cats: ids]
else
["NOT c.secure"]
["NOT c.read_restricted"]
end
where("category_id IS NULL OR category_id IN (
@ -629,8 +629,8 @@ class Topic < ActiveRecord::Base
self
end
def secure_category?
category && category.secure
def read_restricted_category?
category && category.read_restricted
end
private
@ -692,6 +692,7 @@ end
# auto_close_at :datetime
# auto_close_user_id :integer
# auto_close_started_at :datetime
# deleted_by_id :integer
#
# Indexes
#