mirror of
https://github.com/discourse/discourse.git
synced 2025-08-21 19:11:18 +08:00
secure the links on the topic pages, eliminated deleted topics as well.
This commit is contained in:
parent
913a607528
commit
870e59883b
9 changed files with 137 additions and 70 deletions
|
@ -16,6 +16,15 @@ class SqlBuilder
|
|||
end
|
||||
end
|
||||
|
||||
def secure_category(secure_category_ids, category_alias = 'c')
|
||||
if secure_category_ids.present?
|
||||
where("NOT COALESCE(" << category_alias << ".secure, false) OR " << category_alias << ".id IN (:secure_category_ids)", secure_category_ids: secure_category_ids)
|
||||
else
|
||||
where("NOT COALESCE(" << category_alias << ".secure, false)")
|
||||
end
|
||||
self
|
||||
end
|
||||
|
||||
def to_sql
|
||||
sql = @sql.dup
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue