Prevent unauthenticated users commenting on notes via the API
This commit is contained in:
parent
5d916975db
commit
efd2b92a80
2 changed files with 4 additions and 4 deletions
|
@ -9,11 +9,11 @@ class GuestApiAbilityTest < ApiAbilityTest
|
|||
test "note permissions for a guest" do
|
||||
ability = ApiAbility.new nil
|
||||
|
||||
[:index, :create, :comment, :feed, :show, :search].each do |action|
|
||||
[:index, :create, :feed, :show, :search].each do |action|
|
||||
assert ability.can?(action, Note), "should be able to #{action} Notes"
|
||||
end
|
||||
|
||||
[:close, :reopen, :destroy].each do |action|
|
||||
[:comment, :close, :reopen, :destroy].each do |action|
|
||||
assert ability.cannot?(action, Note), "should not be able to #{action} Notes"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue