Fixing neglect to determine whether a user has the permission to create a topic on a category (besides being able to create a post) in ListController, TopicList, and TopicListSerializer causing the "Create Topic" button to appear even if a user cannot actually create a topic in that category but can reply to a topic therein.

This commit is contained in:
Autumn Perrault
2013-11-19 05:09:58 -07:00
parent d4435ba2ac
commit d9c026bec5
4 changed files with 17 additions and 3 deletions

View File

@@ -244,7 +244,9 @@ class Guardian
end
def can_create_topic?(parent)
user && user.trust_level >= SiteSetting.min_trust_to_create_topic.to_i && can_create_post?(parent)
user &&
user.trust_level >= SiteSetting.min_trust_to_create_topic.to_i &&
can_create_post?(parent)
end
def can_create_topic_on_category?(category)