Skip to content
Permalink
Browse files

[JENKINS-37741] Testing /project path ont allowGitlabWebHookPermissio…

…n check
  • Loading branch information...
Jairo Ricarte
Jairo Ricarte committed Sep 13, 2016
1 parent 4ec3989 commit 9e1768a3cf3b85cf7d144b19be9a338280ff3375
Showing with 10 additions and 3 deletions.
  1. +10 −3 src/main/java/org/jenkinsci/plugins/GitLabRequireOrganizationMembershipACL.java
@@ -134,7 +134,6 @@ public boolean hasPermission(Authentication a, Permission permission) {
}
}
}

// no match.
return false;
} else {
@@ -145,12 +144,10 @@ public boolean hasPermission(Authentication a, Permission permission) {
log.finest("Granting Full rights to SYSTEM user.");
return true;
}

if (authenticatedUserName.equals("anonymous")) {
if(checkJobStatusPermission(permission) && allowAnonymousJobStatusPermission) {
return true;
}

if (checkReadPermission(permission)) {
if (allowAnonymousReadPermission) {
return true;
@@ -168,6 +165,16 @@ public boolean hasPermission(Authentication a, Permission permission) {
}
log.finer("Denying anonymous READ permission to url: " + requestURI());
}

if (testBuildPermission(permission)) {
if (allowGitlabWebHookPermission &&
(currentUriPathStartsWith("/project/") ||
currentUriPathEquals("gitlab-webhook") ||
currentUriPathEquals("gitlab-webhook/"))) {
log.finest("Granting BUILD access for gitlab-webhook url: " + requestURI());
return true;
}
}
return false;
}

0 comments on commit 9e1768a

Please sign in to comment.
You can’t perform that action at this time.