8000 Merge pull request #81 from johnjmaguire/master · jpigree/github-oauth-plugin@05313d0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 05313d0

Browse files
authored
Merge pull request jenkinsci#81 from johnjmaguire/master
[JENKINS-40566] Allow collaborators to cancel/abort a build
2 parents 4aea814 + 0569176 commit 05313d0

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/main/java/org/jenkinsci/plugins/GithubRequireOrganizationMembershipACL.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,8 @@ public boolean hasRepositoryPermission(GithubAuthenticationToken authenticationT
260260
if (permission.equals(Item.READ) ||
261261
permission.equals(Item.CONFIGURE) ||
262262
permission.equals(Item.DELETE) ||
263-
permission.equals(Item.EXTENDED_READ)) {
263+
permission.equals(Item.EXTENDED_READ) ||
264+
permission.equals(Item.CANCEL)) {
264265
return true;
265266
} else {
266267
return false;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div>
22
If checked will use github repository permissions to determine jenkins permissions for each project.
33
<ul>
4-
<li>Public projects - all authenticated users can READ. Only collaborators can BUILD, EDIT, CONFIGURE or DELETE.
5-
<li>Private projects, only collaborators can READ, BUILD, EDIT, CONFIGURE or DELETE
4+
<li>Public projects - all authenticated users can READ. Only collaborators can BUILD, EDIT, CONFIGURE, CANCEL or DELETE.
5+
<li>Private projects, only collaborators can READ, BUILD, EDIT, CONFIGURE, CANCEL or DELETE
66
</ul>
77
</div>

src/test/java/org/jenkinsci/plugins/GithubRequireOrganizationMembershipACLTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ public void testCanReadConfigureDeleteAProjectWithAuthenticatedUserReadPermissio
463463
assertTrue(acl.hasPermission(authenticationToken, Item.CONFIGURE));
464464
assertTrue(acl.hasPermission(authenticationToken, Item.DELETE));
465465
assertTrue(acl.hasPermission(authenticationToken, Item.EXTENDED_READ));
466+
assertTrue(acl.hasPermission(authenticationToken, Item.CANCEL));
466467
}
467468

468469
@Test
@@ -480,6 +481,7 @@ public void testCannotReadConfigureDeleteAProjectWithoutToAuthenticatedUserReadP
480481
assertFalse(acl.hasPermission(authenticationToken, Item.CONFIGURE));
481482
assertFalse(acl.hasPermission(authenticationToken, Item.DELETE));
482483
assertFalse(acl.hasPermission(authenticationToken, Item.EXTENDED_READ));
484+
assertFalse(acl.hasPermission(authenticationToken, Item.CANCEL));
483485
}
484486

485487
@Test

0 commit comments

Comments
 (0)
0