stable

Clone or download

Read-only

Don't show empty changeset in GET Rest route

This is part of story #19275 restrict who can see comments The goal of this patch is to be compliant with artifact view. All changesets that you can see in API Rest, should be the same in artifact view. Of course, there is one more changeset with API Rest, because this is the initial changeset. How to test: - Have 2 users: "Alice" and "Bob" - Alice is in a ugroup "ugroup_alice" - Have a field that only Alice can see - Have some changesets in an artifact: - With comment and field that Bob can see - With comment and field that Bot CAN NOT see - With private comment and field that Bob can see - With private comment and field that Bob CAN NOT see - With comment only - With change on field that Bob can see only => Use REST route artifacts/$id/changeset Expected results: - With field mode 'all': |- With Alice: => She can see all changesets |- With Bob: => He can see only changeset with comment or changes. There are no changesets with no changes. - With field mode 'comment': |- With Alice: => She can see all comments, private and public |- With Bob: => There are no empty comments Change-Id: I7d3d122a9088bada5ed94807c640e0836a32c9d5

Modified Files

Name
M plugins/tracker/include/REST/Artifact/ArtifactRepresentationBuilder.php +18 −13 Go to diff View file
M plugins/tracker/include/REST/Artifact/Changeset/ChangesetRepresentationBuilder.php +50 −1 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/Tracker_Artifact_ChangesetValue.class.php +13 −0 Go to diff View file
M plugins/tracker/tests/rest/PrivateComment/PrivateCommentArtifactTest.php +138 −4 Go to diff View file
M plugins/tracker/tests/rest/TrackerBase.php +6 −1 Go to diff View file
M plugins/tracker/tests/rest/_fixtures/PrivateCommentArtifact/project.xml +104 −0 Go to diff View file
M plugins/tracker/tests/unit/REST/Artifact/ArtifactRepresentationBuilderTest.php +3 −3 Go to diff View file
M plugins/tracker/tests/unit/REST/Artifact/Changeset/ChangesetRepresentationBuilderTest.php +100 −10 Go to diff View file