mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: lounge category security settings won't be reset after an upgrade
This commit is contained in:
parent
0de5d01d79
commit
6aa0823bf4
@ -43,7 +43,7 @@ class CategorySerializer < BasicCategorySerializer
|
|||||||
end
|
end
|
||||||
|
|
||||||
def include_is_special?
|
def include_is_special?
|
||||||
[SiteSetting.lounge_category_id, SiteSetting.meta_category_id, SiteSetting.staff_category_id, SiteSetting.uncategorized_category_id]
|
[SiteSetting.meta_category_id, SiteSetting.staff_category_id, SiteSetting.uncategorized_category_id]
|
||||||
.include? object.id
|
.include? object.id
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
unless Rails.env.test?
|
unless Rails.env.test?
|
||||||
lounge = Category.find_by(id: SiteSetting.lounge_category_id)
|
lounge = Category.find_by(id: SiteSetting.lounge_category_id)
|
||||||
if lounge and !lounge.group_ids.include?(Group[:trust_level_3].id)
|
if lounge && lounge.created_at == lounge.updated_at &&
|
||||||
|
!lounge.group_ids.include?(Group[:trust_level_3].id)
|
||||||
|
|
||||||
# The category for users with trust level 3 has been created.
|
# The category for users with trust level 3 has been created.
|
||||||
# Add permissions and a description to it.
|
# Add initial permissions and description. They can be changed later.
|
||||||
|
|
||||||
Category.transaction do
|
Category.transaction do
|
||||||
lounge.group_names = ['trust_level_3']
|
lounge.group_names = ['trust_level_3']
|
||||||
|
Loading…
Reference in New Issue
Block a user