-
Notifications
You must be signed in to change notification settings - Fork 23
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-74820 - forceSandBox - Hide command-launcher drop down from non-administrators #103
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…dministrators - Tests
…dministrators - Tests
…dministrators - Tests
…dministrators - Tests
…dministrators - Tests
…dministrators - Tests
amuniz
reviewed
Nov 12, 2024
Co-authored-by: Antonio Muniz <amuniz@users.noreply.github.com>
jglick
reviewed
Nov 12, 2024
jglick
reviewed
Nov 12, 2024
jglick
reviewed
Nov 12, 2024
jglick
reviewed
Nov 12, 2024
jglick
reviewed
Nov 12, 2024
src/test/java/hudson/slaves/CommandLauncherForceSandboxTest.java
Outdated
Show resolved
Hide resolved
jglick
reviewed
Nov 12, 2024
Co-authored-by: Jesse Glick <jglick@cloudbees.com>
jglick
approved these changes
Nov 12, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
JENKINS-74820 - forceSandBox - Hide command-launcher drop down from non-administrators
Breaking changes:
This relies on jenkinsci/jenkins#9495 for managing error messages when saving Command-Launcher in non allowed cases (nonAdmin users saving an existing node with Launcher = commandLauncher when forceSandbox is enabled)
In order to do so, we have modified from:
So in order to use it we need to modify the implementations using the "constructor CommandLauncher(String command)" to proper handle the exception "Descriptor.FormException"
Related to jenkinsci/script-security-plugin#585
Related to JENKINS-73941 - Option to hide "Use Groovy Sandbox" for users without Administer permission globally in the system.
When creating new nodes in the system based on the Launch Method "Launch agent via execution of command on the controller", the plugin Command-Launcher-Plugin does not support the Sandbox execution, so is automatically creating new scripts to be verified by the admin.
In the context of the forceSandbox changes implemented in JENKINS-73941, this is not allowed, so we should hide this option in this case.
We have implemented a new DescriptorVisibilityFilter to verify this case of use:
Tests Implemented:
This covers all the scenarios:
*When editing a node, if the user is non admin and forceSandbox is enabled, the CommandLauncher Descriptor is not offered, except if the existing node already has this Launcher configured
Manual tests:
Submitter checklist
CC: @jglick, @amuniz.