mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Add Create Topic button to /categories page
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
class CategoryListSerializer < ApplicationSerializer
|
||||
|
||||
attributes :can_create_category
|
||||
attributes :can_create_category, :can_create_topic
|
||||
|
||||
has_many :categories, serializer: CategoryDetailedSerializer, embed: :objects
|
||||
|
||||
@@ -8,4 +8,8 @@ class CategoryListSerializer < ApplicationSerializer
|
||||
scope.can_create?(Category)
|
||||
end
|
||||
|
||||
def can_create_topic
|
||||
scope.can_create?(Topic)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user