Redmine 4.1.7
This commit is contained in:
parent
55458d3479
commit
3ca3c37487
103 changed files with 2426 additions and 431 deletions
|
@ -531,6 +531,23 @@ class AttachmentsControllerTest < Redmine::ControllerTest
|
|||
assert_response 403
|
||||
end
|
||||
|
||||
def test_edit_all_issue_attachment_by_user_without_edit_issue_permission_on_tracker_should_return_404
|
||||
role = Role.find(2)
|
||||
role.set_permission_trackers 'edit_issues', [2, 3]
|
||||
role.save!
|
||||
|
||||
@request.session[:user_id] = 2
|
||||
|
||||
get(
|
||||
:edit_all,
|
||||
:params => {
|
||||
:object_type => 'issues',
|
||||
:object_id => '4'
|
||||
}
|
||||
)
|
||||
assert_response 404
|
||||
end
|
||||
|
||||
def test_update_all
|
||||
@request.session[:user_id] = 2
|
||||
patch :update_all, :params => {
|
||||
|
@ -659,4 +676,25 @@ class AttachmentsControllerTest < Redmine::ControllerTest
|
|||
assert_response 302
|
||||
assert Attachment.find_by_id(3)
|
||||
end
|
||||
|
||||
def test_destroy_issue_attachment_by_user_without_edit_issue_permission_on_tracker
|
||||
role = Role.find(2)
|
||||
role.set_permission_trackers 'edit_issues', [2, 3]
|
||||
role.save!
|
||||
|
||||
@request.session[:user_id] = 2
|
||||
|
||||
set_tmp_attachments_directory
|
||||
assert_no_difference 'Attachment.count' do
|
||||
delete(
|
||||
:destroy,
|
||||
:params => {
|
||||
:id => 7
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
assert_response 403
|
||||
assert Attachment.find_by_id(7)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue