Prevent unauthenticated users commenting on notes via the API

This commit is contained in:
Tom Hughes 2023-11-23 16:46:36 +00:00
parent 5d916975db
commit efd2b92a80
2 changed files with 4 additions and 4 deletions

View file

@ -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