File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
src/main/java/io/jenkins/plugins/gitlabserverconfig/servers Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 7
7
import com .cloudbees .plugins .credentials .SystemCredentialsProvider ;
8
8
import com .cloudbees .plugins .credentials .common .StandardCredentials ;
9
9
import com .cloudbees .plugins .credentials .common .StandardListBoxModel ;
10
+ import com .cloudbees .plugins .credentials .domains .DomainRequirement ;
10
11
import edu .umd .cs .findbugs .annotations .CheckForNull ;
11
12
import edu .umd .cs .findbugs .annotations .NonNull ;
12
13
import hudson .Extension ;
24
25
import java .net .MalformedURLException ;
25
26
import java .net .URL ;
26
27
import java .security .SecureRandom ;
28
+ import java .util .ArrayList ;
27
29
import java .util .Collections ;
28
30
import java .util .List ;
29
31
import java .util .logging .Level ;
@@ -374,9 +376,12 @@ public Secret getSecretToken() {
374
376
375
377
private StringCredentials getWebhookSecretCredentials (String webhookSecretCredentialsId ) {
376
378
Jenkins jenkins = Jenkins .get ();
377
- jenkins .checkPermission (Jenkins .ADMINISTER );
378
- return StringUtils .isBlank (webhookSecretCredentialsId ) ? null : CredentialsMatchers .firstOrNull (
379
- lookupCredentials (StringCredentials .class , jenkins ),
379
+ return StringUtils .isBlank (webhookSecretCredentialsId ) ? null
380
+ : CredentialsMatchers .firstOrNull (lookupCredentials (
381
+ StringCredentials .class ,
382
+ jenkins ,
383
+ ACL .SYSTEM ,
384
+ new ArrayList <DomainRequirement >()),
380
385
withId (webhookSecretCredentialsId )
381
386
);
382
387
}
You can’t perform that action at this time.
0 commit comments