Merge pull request #2971 from cpradio/pr-fix-allowed-category-ids-for-group-posts
FIX: Change is_staff to is_admin for group posts to match other places
This commit is contained in:
commit
c059352484
|
@ -42,7 +42,7 @@ class Group < ActiveRecord::Base
|
||||||
.where('topics.archetype <> ?', Archetype.private_message)
|
.where('topics.archetype <> ?', Archetype.private_message)
|
||||||
.where(post_type: Post.types[:regular])
|
.where(post_type: Post.types[:regular])
|
||||||
|
|
||||||
unless guardian.is_staff?
|
unless guardian.is_admin?
|
||||||
allowed_ids = guardian.allowed_category_ids
|
allowed_ids = guardian.allowed_category_ids
|
||||||
if allowed_ids.length > 0
|
if allowed_ids.length > 0
|
||||||
result = result.where('topics.category_id IS NULL or topics.category_id IN (?)', allowed_ids)
|
result = result.where('topics.category_id IS NULL or topics.category_id IN (?)', allowed_ids)
|
||||||
|
|
Loading…
Reference in New Issue