stable

Clone or download

Read-only

Apply set build status permissions in /git/:id_or_path/statuses/:commit_reference

part of: story #18320 native support of pull requests in tuleap branch source jenkins plugin How to test: - Pick up a repository - Go to its administration, pane ci-token - Give the permission to set builds statuses to a group you are a member - Using the API explorer, go to the route /git/:id_or_path/statuses/:commit_reference - enter the id of a repository and the sha1 of a commit - remove the field "token" in the payload - Submit --> it works - Query the same route but using curl (add your access key in the headers) --> it works - Now remove the permission for the group(s) your are a member - Re-submit your request on the rest route --> 403 forbiden --> Same status code with curl - Add the field "token" in the payload and fill it with the ci-token - Submit once again --> it works Change-Id: Ibd0153c2d99a22bbfc07d3791065f90415e2ad96

Modified Files

Name
M plugins/git/include/CIToken/BuildStatusChangePermissionManager.php +17 −3 Go to diff View file
M plugins/git/include/REST/v1/RepositoryResource.class.php +37 −5 Go to diff View file
A plugins/git/tests/unit/CIToken/BuildStatusChangePermissionManagerTest.php +129 −0 Go to diff View file