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

[JENKINS-73053] Allow users with Overall/Manage permission to configure endpoints #784

Merged
merged 2 commits into from
May 2, 2024

Conversation

amuniz
Copy link
Member

@amuniz amuniz commented Apr 23, 2024

Description

Allow users with Overall/Manage permission to configure endpoints. See JENKINS-73053 for further information.

Submitter checklist

  • Link to JIRA ticket in description, if appropriate.
  • Change is code complete and matches issue description
  • Automated tests have been added to exercise the changes
  • Reviewer's manual test instructions provided in PR description. See Reviewer's first task below.

Reviewer checklist

  • Run the changes and verify that the change matches the issue description
  • Reviewed the code
  • Verified that the appropriate tests have been written or valid explanation given

Documentation changes

  • Link to jenkins.io PR, or an explanation for why no doc changes are needed

Users/aliases to notify

@amuniz amuniz requested a review from a team as a code owner April 23, 2024 09:14
@jglick
Copy link
Member

jglick commented Apr 24, 2024

Do I get it right that this only fixes permission checks on form validation and dropdowns and that the actual submission of a new endpoint was already allowed?

@amuniz
Copy link
Member Author

amuniz commented Apr 25, 2024

I was missing a getRequiredGlobalConfigPagePermission override. Fixed it and added a test for it.
Thanks for the catch!

@@ -90,6 +91,13 @@ public void canPostAsAdmin_doCheckApiUri() throws Exception {
assertTrue(TestRoot.get().visited);
}

@Test

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Issue("JENKINS-73053")
public void manageCanSetupEndpoints() throws Exception {
HtmlPage htmlPage = j.createWebClient().login("alice").goTo("manage/configure");
assertTrue(htmlPage.getVisibleText().contains("GitHub Enterprise Servers"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not verify that you can actually save new endpoints, but that is much harder to test in WebClient (given YUI craziness), and I guess ought to be implied by the same getRequiredGlobalConfigPagePermission. Did you at least try it interactively? (Most easily by just setting a breakpoint in this test and then logging in as alice / alice from a real browser.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified manually. It works as expected.

@jglick jglick merged commit 5b0c0ce into jenkinsci:master May 2, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants