summaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-07-25 06:44:01 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-07-25 06:44:01 +0000
commit1def32c4dda9eb78ac6537d5270d5df83c7e98ba (patch)
treecfbd1acc69bc9a2e89d763e28cca2791a1bfaab8 /test/unit
parentf1072337b9bcf5dae542780784e037b39ca52468 (diff)
downloadredmine-1def32c4dda9eb78ac6537d5270d5df83c7e98ba.tar.gz
redmine-1def32c4dda9eb78ac6537d5270d5df83c7e98ba.zip
Fixed that members without view issues permission are able to list issues on public projects if the non member role has the permission (#20206).
git-svn-id: http://svn.redmine.org/redmine/trunk@14450 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/issue_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb
index bf4d49492..9a8afd66d 100644
--- a/test/unit/issue_test.rb
+++ b/test/unit/issue_test.rb
@@ -310,6 +310,15 @@ class IssueTest < ActiveSupport::TestCase
assert_visibility_match user, issues
end
+ def test_visible_scope_for_member_without_view_issues_permission_and_non_member_role_having_the_permission
+ Role.non_member.add_permission!(:view_issues)
+ Role.find(1).remove_permission!(:view_issues)
+ user = User.find(2)
+
+ assert_equal 0, Issue.where(:project_id => 1).visible(user).count
+ assert_equal false, Issue.where(:project_id => 1).first.visible?(user)
+ end
+
def test_visible_scope_for_member_with_groups_should_return_assigned_issues
user = User.find(8)
assert user.groups.any?