mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 12:38:07 +08:00
work in progress, add fidelity to category group permissions (full, create posts, readonly)
This commit is contained in:
@ -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
|
||||
#
|
||||
|
Reference in New Issue
Block a user