Listing credentials authorisation check#222
Listing credentials authorisation check#222ChampiYann wants to merge 7 commits intojenkinsci:masterfrom
Conversation
Signed-off-by: Yann Rosema <yann.rosema@hotmail.com>
Signed-off-by: Yann Rosema <yann.rosema@hotmail.com>
Signed-off-by: Yann Rosema <yann.rosema@hotmail.com>
Signed-off-by: Yann Rosema <yann.rosema@hotmail.com>
| } | ||
| if (itemGroup instanceof AbstractFolder) { | ||
| final AbstractFolder<?> folder = AbstractFolder.class.cast(itemGroup); | ||
| if (folder.hasPermission(authentication, CredentialsProvider.USE_ITEM)) { |
There was a problem hiding this comment.
I think this should allow for listing credentials if the user can also configure the itemgroup (as they may be able to select a credential that the system (not they themselves) will use later
(note the follow syntax has not been checked)
| if (folder.hasPermission(authentication, CredentialsProvider.USE_ITEM)) { | |
| if (folder.hasPermission(authentication, CredentialsProvider.USE_ITEM) || folder.hasPermission(authentication, Item.CONFIGURE)) { |
@daniel-beck I always have to double think this - but for listing the credential IDs it should be you have configure on the item, or the ability to use a credntials. (configure so you can select a credential that the job/system can use even if you can not use it, USE_ITEM incase you can not configure the job (e.g. for the pipeline snippet generator at the job level and the pipeline is "as-code")?
There was a problem hiding this comment.
Hi, I'm assuming we're waiting for @daniel-beck 's response on this. Is there any indication on when we can expect that?
src/main/java/com/cloudbees/hudson/plugins/folder/properties/FolderCredentialsProvider.java
Outdated
Show resolved
Hide resolved
src/main/java/com/cloudbees/hudson/plugins/folder/properties/FolderCredentialsProvider.java
Outdated
Show resolved
Hide resolved
src/main/java/com/cloudbees/hudson/plugins/folder/properties/FolderCredentialsProvider.java
Outdated
Show resolved
Hide resolved
src/main/java/com/cloudbees/hudson/plugins/folder/properties/FolderCredentialsProvider.java
Outdated
Show resolved
Hide resolved
src/main/java/com/cloudbees/hudson/plugins/folder/properties/FolderCredentialsProvider.java
Outdated
Show resolved
Hide resolved
src/main/java/com/cloudbees/hudson/plugins/folder/properties/FolderCredentialsProvider.java
Outdated
Show resolved
Hide resolved
Co-authored-by: James Nord <jtnord@users.noreply.github.com>
There is a comment in this Github issue detailing the problem this pull requests tries to fix.
It comes down to adding a check to the getCredentials method to check if the user requesting the credentials is permitted to use the credentials of a provider.
Proposed changelog entries
CredentialsProvider.USE_ITEMpermission.Submitter checklist
* Use the
Internal:prefix if the change has no user-visible impact (API, test frameworks, etc.)