stable

Clone or download

Read-only

Display ugroups in private comment in artifact/$id/changeset REST route

This is part of story #19275 restrict who can see comments How to test: - Have 6 users |_ Site admin |_ Project admin |_ Tracker admin |_ User A in group 'ugroup_A' |_ User B in group 'ugroup_B' |_ User C in no group - In an artifact, write a followup and get its id in tracker_changeset_comment table - In plugin_tracker_private_comment_permission, add rows |_ comment_id, ugroup_A_id |_ comment_id, ugroup_B_id Expected results: - Use artifact/$id/changeset REST route with all 6 users |_ Site admin, Project admin and Tracker admin see the comment and 2 groups |_ User A sees the comment with only 'ugroup_A' |_ User B sees the comment with only 'ugroup_B' |_ User C doesn't see the comment, and see none ugroup Change-Id: I38dfa3d1655726476f0ecca8215cfee60e133a99

Modified Files

Name
M plugins/tracker/include/REST/Artifact/Changeset/ChangesetRepresentationBuilder.php +9 −4 Go to diff View file
M plugins/tracker/include/REST/Artifact/Changeset/Comment/CommentRepresentationBuilder.php +35 −3 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/Changeset/Comment/PrivateComment/PermissionChecker.php +34 −0 Go to diff View file
A plugins/tracker/include/Tracker/Artifact/Changeset/Comment/PrivateComment/UserIsNotAllowedToSeeUGroups.php +35 −0 Go to diff View file
M plugins/tracker/tests/rest/Artifacts/PrivateCommentArtifactTest.php +158 −3 Go to diff View file
M plugins/tracker/tests/rest/DataBuilder.php +12 −6 Go to diff View file
M plugins/tracker/tests/rest/_fixtures/PrivateCommentArtifact/project.xml +18 −1 Go to diff View file
M plugins/tracker/tests/rest/_fixtures/PrivateCommentArtifact/user_map.csv +3 −0 Go to diff View file
M plugins/tracker/tests/rest/_fixtures/PrivateCommentArtifact/users.xml +21 −0 Go to diff View file
M plugins/tracker/tests/unit/REST/Artifact/Changeset/ChangesetRepresentationBuilderTest.php +17 −2 Go to diff View file
M plugins/tracker/tests/unit/REST/Artifact/Changeset/Comment/CommentRepresentationBuilderTest.php +60 −4 Go to diff View file
M plugins/tracker/tests/unit/Tracker/Artifact/Changeset/Comment/PrivateComment/PermissionCheckerTest.php +116 −0 Go to diff View file