mirror of
https://github.com/discourse/discourse.git
synced 2026-08-07 19:55:17 -05:00
Moderators should always be able to create topics too
This commit is contained in:
@@ -7,7 +7,7 @@ module TopicGuardian
|
||||
|
||||
# Creating Methods
|
||||
def can_create_topic?(parent)
|
||||
is_admin? ||
|
||||
is_staff? ||
|
||||
(user &&
|
||||
user.trust_level >= SiteSetting.min_trust_to_create_topic.to_i &&
|
||||
can_create_post?(parent))
|
||||
|
||||
@@ -415,6 +415,7 @@ describe Guardian do
|
||||
Guardian.new(build(:user, trust_level: 1)).can_create?(Topic,Fabricate(:category)).should be_true
|
||||
Guardian.new(build(:user, trust_level: 2)).can_create?(Topic,Fabricate(:category)).should be_true
|
||||
Guardian.new(build(:admin, trust_level: 0)).can_create?(Topic,Fabricate(:category)).should be_true
|
||||
Guardian.new(build(:moderator, trust_level: 0)).can_create?(Topic,Fabricate(:category)).should be_true
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user