Skip to content

Commit cd7f106

Browse files
authored
Merge pull request #155 from Vlatombe/fix-viewcredentialsaction
Credentials action should be hidden only for the root Jenkins, not for folders or users
2 parents 6fa3a77 + e987f5c commit cd7f106

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/main/java/com/cloudbees/plugins/credentials/ViewCredentialsAction.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,13 +241,12 @@ public boolean isVisible() {
241241
}
242242

243243
/**
244-
* Administrator's view credentials from 'Manage Jenkins', except when it's a folder.
244+
* Administrator's view credentials from 'Manage Jenkins'.
245245
* @param accessControlled an access controlled object.
246246
* @return whether the action should be visible or not if the user is an administrator.
247247
*/
248248
private boolean isVisibleForAdministrator(AccessControlled accessControlled) {
249-
return accessControlled.hasPermission(Jenkins.ADMINISTER) &&
250-
!accessControlled.getClass().getName().equals("com.cloudbees.hudson.plugins.folder.Folder");
249+
return accessControlled instanceof Jenkins && accessControlled.hasPermission(Jenkins.ADMINISTER);
251250
}
252251

253252
/**

0 commit comments

Comments
 (0)