FIX: admins should be able to create topics, even if min_trust_to_create_topic is higher than their trust level

This commit is contained in:
Neil Lalonde
2014-06-09 11:03:10 -04:00
parent b16c18e667
commit 4d50d0d109
2 changed files with 5 additions and 3 deletions
+4 -3
View File
@@ -7,9 +7,10 @@ module TopicGuardian
# Creating Methods
def can_create_topic?(parent)
user &&
user.trust_level >= SiteSetting.min_trust_to_create_topic.to_i &&
can_create_post?(parent)
is_admin? ||
(user &&
user.trust_level >= SiteSetting.min_trust_to_create_topic.to_i &&
can_create_post?(parent))
end
def can_create_topic_on_category?(category)