mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 15:48:43 -05:00
BUGFIX: make the system_user an elder (TL=4)
Otherwise it won't be able to create topic when the `min_trust_to_create_topic` is > 0
This commit is contained in:
parent
5a3c77abd9
commit
1fd71bb237
2 changed files with 7 additions and 7 deletions
|
@ -22,4 +22,5 @@ User.seed do |u|
|
|||
u.email_direct = false
|
||||
u.approved = true
|
||||
u.email_private_messages = false
|
||||
u.trust_level = TrustLevel.levels[:elder]
|
||||
end
|
||||
|
|
|
@ -27,18 +27,17 @@ 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)
|
||||
user &&
|
||||
user.trust_level >= SiteSetting.min_trust_to_create_topic.to_i &&
|
||||
can_create_post?(parent)
|
||||
end
|
||||
|
||||
def can_create_topic_on_category?(category)
|
||||
can_create_topic?(nil) && (
|
||||
!category ||
|
||||
Category.topic_create_allowed(self).where(:id => category.id).count == 1
|
||||
)
|
||||
can_create_topic?(nil) &&
|
||||
(!category || Category.topic_create_allowed(self).where(:id => category.id).count == 1)
|
||||
end
|
||||
|
||||
def can_create_post_on_topic?(topic)
|
||||
|
||||
# No users can create posts on deleted topics
|
||||
return false if topic.trashed?
|
||||
|
||||
|
@ -82,4 +81,4 @@ module TopicGuardian
|
|||
(not(topic.private_message?) || authenticated? && (topic.all_allowed_users.where(id: @user.id).exists? || is_staff?))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue