FIX: Don't allow editing seeded category security settings

This commit is contained in:
Kane York
2015-09-10 14:04:21 -07:00
parent ad481b3427
commit d86d4752cb
5 changed files with 30 additions and 10 deletions

View File

@ -11,6 +11,7 @@ class CategorySerializer < BasicCategorySerializer
:suppress_from_homepage,
:can_delete,
:cannot_delete_reason,
:is_special,
:allow_badges,
:custom_fields
@ -37,6 +38,11 @@ class CategorySerializer < BasicCategorySerializer
true
end
def is_special
[SiteSetting.lounge_category_id, SiteSetting.meta_category_id, SiteSetting.staff_category_id, SiteSetting.uncategorized_category_id]
.include? object.id
end
def include_can_delete?
scope && scope.can_delete?(object)
end