FIX: Don't show the category edit button unless the user can edit the

category
This commit is contained in:
Robin Ward
2014-08-12 13:30:28 -04:00
parent c74550fbad
commit 36f081bf43
4 changed files with 13 additions and 4 deletions

View File

@ -14,7 +14,8 @@ class BasicCategorySerializer < ApplicationSerializer
:parent_category_id,
:notification_level,
:logo_url,
:background_url
:background_url,
:can_edit
def include_parent_category_id?
parent_category_id
@ -23,4 +24,12 @@ class BasicCategorySerializer < ApplicationSerializer
def description
object.uncategorized? ? SiteSetting.uncategorized_description : object.description
end
def can_edit
true
end
def include_can_edit?
scope && scope.can_edit?(object)
end
end