diff options
author | Marius Balteanu <marius.balteanu@zitec.com> | 2021-08-06 07:00:25 +0000 |
---|---|---|
committer | Marius Balteanu <marius.balteanu@zitec.com> | 2021-08-06 07:00:25 +0000 |
commit | 22e90f5b49e89ff33cac55f7efc1c3a56a5b4a1e (patch) | |
tree | d51347fa52537291c3e4a957bca5a011d3a7a4b2 | |
parent | f63341e145bd88dfdce0e7a124159a647943dffd (diff) | |
download | redmine-22e90f5b49e89ff33cac55f7efc1c3a56a5b4a1e.tar.gz redmine-22e90f5b49e89ff33cac55f7efc1c3a56a5b4a1e.zip |
Merged r21141 to 4.1-stable (#35634).
git-svn-id: http://svn.redmine.org/redmine/branches/4.1-stable@21145 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | test/functional/attachments_controller_test.rb | 17 | ||||
-rw-r--r-- | test/functional/issues_controller_test.rb | 13 |
2 files changed, 30 insertions, 0 deletions
diff --git a/test/functional/attachments_controller_test.rb b/test/functional/attachments_controller_test.rb index 831c6e5fb..7ffe20423 100644 --- a/test/functional/attachments_controller_test.rb +++ b/test/functional/attachments_controller_test.rb @@ -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 => { diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 48ecddafd..3491e0c2d 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -2674,6 +2674,19 @@ class IssuesControllerTest < Redmine::ControllerTest end end + def test_show_should_not_display_edit_attachment_icon_for_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 + + get :show, params: {id: 4} + + assert_response :success + assert_select 'div.attachments .icon-edit', 0 + end + def test_get_new @request.session[:user_id] = 2 get :new, :params => { |