Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 'missing the Job/Configure permssion' error on Branch Sources page #822

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@
@SuppressWarnings("unused") // used By stapler
public ListBoxModel doFillServerUrlItems(@AncestorInPath SCMSourceOwner context) {
AccessControlled contextToCheck = context == null ? Jenkins.get() : context;
if (!contextToCheck.hasPermission(Item.CONFIGURE)) {
if (!contextToCheck.hasAnyPermission(Item.CONFIGURE, Item.EXTENDED_READ)) {

Check warning on line 642 in src/main/java/com/cloudbees/jenkins/plugins/bitbucket/BitbucketSCMNavigator.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 642 is only partially covered, one branch is missing
return new ListBoxModel();
}
return BitbucketEndpointConfiguration.get().getEndpointItems();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,7 @@
@SuppressWarnings("unused") // used By stapler
public static FormValidation doCheckServerUrl(@AncestorInPath SCMSourceOwner context, @QueryParameter String value) {
AccessControlled contextToCheck = context == null ? Jenkins.get() : context;
contextToCheck.checkPermission(Item.CONFIGURE);
contextToCheck.checkAnyPermission(Item.CONFIGURE, Item.EXTENDED_READ);

Check warning on line 1343 in src/main/java/com/cloudbees/jenkins/plugins/bitbucket/BitbucketSCMSource.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 1343 is not covered by tests
if (BitbucketEndpointConfiguration.get().findEndpoint(value) == null) {
return FormValidation.error("Unregistered Server: " + value);
}
Expand All @@ -1367,7 +1367,7 @@
@SuppressWarnings("unused") // used By stapler
public ListBoxModel doFillServerUrlItems(@AncestorInPath SCMSourceOwner context) {
AccessControlled contextToCheck = context == null ? Jenkins.get() : context;
if (!contextToCheck.hasPermission(Item.CONFIGURE)) {
if (!contextToCheck.hasAnyPermission(Item.CONFIGURE, Item.EXTENDED_READ)) {

Check warning on line 1370 in src/main/java/com/cloudbees/jenkins/plugins/bitbucket/BitbucketSCMSource.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 1370 is only partially covered, one branch is missing
return new ListBoxModel();
}
return BitbucketEndpointConfiguration.get().getEndpointItems();
Expand Down
Loading