Skip to content

Commit

Permalink
[JENKINS-72984] read GroupDetails displayname and show in assign page (
Browse files Browse the repository at this point in the history
  • Loading branch information
mawinter69 committed Apr 9, 2024
2 parents 523b13c + a519735 commit 6a69afe
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import hudson.Functions;
import hudson.Util;
import hudson.model.User;
import hudson.security.GroupDetails;
import hudson.security.SecurityRealm;
import hudson.security.UserMayOrMayNotExistException2;
import hudson.util.FormValidation;
Expand Down Expand Up @@ -87,7 +88,8 @@ static String formatUserGroupValidationResponse(AuthorizationType type, String u
static FormValidation validateGroup(String groupName, SecurityRealm sr, boolean ambiguous) {
String escapedSid = Functions.escape(groupName);
try {
sr.loadGroupByGroupname2(groupName, false);
GroupDetails details = sr.loadGroupByGroupname2(groupName, false);
escapedSid = Util.escape(StringUtils.abbreviate(details.getDisplayName(), 50));

Check warning on line 92 in src/main/java/com/michelin/cio/hudson/plugins/rolestrategy/ValidationUtil.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 91-92 are not covered by tests
if (ambiguous) {
return FormValidation.respond(FormValidation.Kind.WARNING,
formatUserGroupValidationResponse(AuthorizationType.GROUP, escapedSid,
Expand Down

0 comments on commit 6a69afe

Please sign in to comment.