summaryrefslogtreecommitdiffstats
path: root/test/functional
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2024-11-03 05:41:19 +0000
committerGo MAEDA <maeda@farend.jp>2024-11-03 05:41:19 +0000
commitc54474eccc970b58ef3c40b620387e522a84b478 (patch)
tree36f2156ef7514c0ce2ead82ae16969787bf8fb8c /test/functional
parent9925a8ecc0df47cd948f3e025f1303b33df3afbe (diff)
downloadredmine-c54474eccc970b58ef3c40b620387e522a84b478.tar.gz
redmine-c54474eccc970b58ef3c40b620387e522a84b478.zip
Fix: "Import issues" and "Import time entries" pages are visible to users without "Add issues" and "Log spent time" permissions (#41465).
Patch by Kenta Kumojima (user:kumojima). git-svn-id: https://svn.redmine.org/redmine/trunk@23178 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/imports_controller_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/functional/imports_controller_test.rb b/test/functional/imports_controller_test.rb
index b4022298a..ad1e1aade 100644
--- a/test/functional/imports_controller_test.rb
+++ b/test/functional/imports_controller_test.rb
@@ -52,6 +52,18 @@ class ImportsControllerTest < Redmine::ControllerTest
assert_select 'input[name=?][type=?][value=?]', 'project_id', 'hidden', 'subproject1'
end
+ def test_new_issue_import_without_add_issues_permission
+ Role.all.map { |role| role.remove_permission! :add_issues }
+ get(:new, :params => {:type => 'IssueImport', :project_id => 'subproject1'})
+ assert_response :forbidden
+ end
+
+ def test_new_time_entry_import_without_log_time_permission
+ Role.all.map { |role| role.remove_permission! :log_time }
+ get(:new, :params => {:type => 'TimeEntryImport', :project_id => 'subproject1'})
+ assert_response :forbidden
+ end
+
def test_create_should_save_the_file
import = new_record(Import) do
post(