mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
Moderators should always be able to create topics too
This commit is contained in:
parent
f97d434174
commit
faed17aa18
2 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue