[JENKINS-41289] use readOnlyMode to include edit-config in show-config #314
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.
Setting var readOnlyMode in jelly will basically disable all inputs, buttons, selects. So in the show-config.jelly files we can just set this var and the include the edit-config. So we no longer need to double maintain the fields.
For those configs that add credentials check the readOnlyMode variable and disable the delete and add buttons accordingly
On order to view a job configuration when one has extended read but no configure it must be avoided that the permissions checks in doCheck and doFill methods check for configure only, they should also allow EXTENDED_READ.
Testing done
Interactive testing
create for each type a config, when credentials are there add and delete buttons are still there and all fields are editable
create freestyle job and add a buildwrapper to provide credentials, for each config type go to the view details link, all fields are readonly and there are no buttons to add/remove credentials.
(note that the email ext plugin provides 2 config file types but misses to provide show-config.jelly files, thus the view details link leads to broken pages, this problem existed before)
Submitter checklist