I'm still playing with it to understand how everything works.
public Map<String,String> getSIDsFullNames(String type) {
SortedSet<String> sids = getRoleMap(RoleType.fromString(type)).getSids();
Map<String, String> sidToUser = new HashMap<String, String>(sids.size());
for(String sid: sids) {
String fullName = User.getById(sid, true).getFullName();
sidToUser.put(sid, fullName);
}
return sidToUser;
}
<j:set var="globalSIDs" value="${it.strategy.getSIDs(it.strategy.GLOBAL)}"/>
into this
<j:set var="globalSIDs" value="${it.strategy.getSIDsFullNames(it.strategy.GLOBAL)}"/>
and in assign-global-roles.jelly I used sid.value instead of sid:
<j:forEach var="sid" items="${globalSIDs}">
<tr name="[${sid.value}]" class="permission-row">
<local:userRow sid="${sid.value}" title="${sid.value}" global="${true}" type="${it.strategy.GLOBAL}"/>
</tr>
<j:set var="nbAssignedGlobalRoles" value="${nbAssignedGlobalRoles+1}" />
</j:forEach>
there is a checkForWhitespace form validation on this form, so it didn't work for user that has a full name with a whitespace.
I did fullname.replaceAll(" ", "_") just to see that it works and it did. I got the user name.
what do you think, is it a good direction?
how should we deal with the whitespace validation?
Thanks,
Tidhar
On Wednesday, July 15, 2020 at 9:59:20 PM UTC+3, Jesse Glick wrote: