stable

Clone or download

Read-only

Hide private comment in artifact/$id/chengeset REST route

This is part of story #19275 restrict who can see comments How to test: - Have 2 users: 'A' and 'B' - Create a user group, and insert user 'A' into - Create a comment in an artifact - Get comment_id of new comment in tracker_changset_comment table - Get ugroup_id in UI or table - Insert comment_id and ugroup_id in plugin_tracker_private_comment_permission table Expected results: - User artifact/$id/changeset REST route with user 'A' and 'B' |_ With user 'A', you can see the new comment |_ With usser 'B', there is no the new comment Comment can be Text/HTML or Markdown format. /!\ There is a new key in comment representation 'ugroup'. For the moment, this key returns "null". In next patch, there will be ugroups that can see private comments instead. Change-Id: I82ce47dd5b66d2e66efe3fc9a5ecfaa0071cdd8b

Modified Files

Name
M plugins/frs/include/FRS/REST/v1/ReleaseRepresentation.php +4 −1 Go to diff View file
M plugins/tracker/include/REST/Artifact/Changeset/ChangesetRepresentationBuilder.php +29 −8 Go to diff View file
M plugins/tracker/include/REST/Artifact/Changeset/Comment/CommentRepresentationBuilder.php +2 −2 Go to diff View file
M plugins/tracker/include/REST/Artifact/Changeset/Comment/CommonMarkCommentRepresentation.php +12 −1 Go to diff View file
M plugins/tracker/include/REST/Artifact/Changeset/Comment/HTMLOrTextCommentRepresentation.php +12 −1 Go to diff View file
M plugins/tracker/include/REST/v1/ArtifactsResource.class.php +4 −1 Go to diff View file
M plugins/tracker/include/REST/v1/ReportsResource.class.php +4 −1 Go to diff View file
M plugins/tracker/include/REST/v1/TrackersResource.class.php +4 −1 Go to diff View file
A plugins/tracker/include/Tracker/Artifact/Changeset/Comment/PrivateComment/PermissionChecker.php +72 −0 Go to diff View file
A plugins/tracker/include/Tracker/Artifact/Changeset/Comment/PrivateComment/TrackerPrivateCommentUGroupPermissionDao.php +39 −0 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/Changeset/PostCreation/ActionsRunner.php +4 −1 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/Tracker_Artifact_Changeset_Comment.class.php +9 −1 Go to diff View file
A plugins/tracker/tests/rest/Artifacts/PrivateCommentArtifactTest.php +63 −0 Go to diff View file
M plugins/tracker/tests/rest/DataBuilder.php +25 −2 Go to diff View file
M plugins/tracker/tests/rest/TrackerBase.php +25 −2 Go to diff View file
A plugins/tracker/tests/rest/_fixtures/PrivateCommentArtifact/project.xml +116 −0 Go to diff View file
A plugins/tracker/tests/rest/_fixtures/PrivateCommentArtifact/user_map.csv +3 −0 Go to diff View file
A plugins/tracker/tests/rest/_fixtures/PrivateCommentArtifact/users.xml +37 −0 Go to diff View file
M plugins/tracker/tests/unit/REST/Artifact/ArtifactRepresentationBuilderTest.php +1 −1 Go to diff View file
M plugins/tracker/tests/unit/REST/Artifact/Changeset/ChangesetRepresentationBuilderTest.php +81 −8 Go to diff View file
A plugins/tracker/tests/unit/Tracker/Artifact/Changeset/Comment/PrivateComment/PermissionCheckerTest.php +156 −0 Go to diff View file
M plugins/tracker/tests/unit/Tracker/Webhook/ArtifactPayloadBuilderTest.php +1 −1 Go to diff View file