userMap classad function yields undefined if user doesn't belong to preferred group

Description

Note: This bug impacts the AssignAccountingGroup meta knob such that if the user does not request a group, or they request a group that they are not allowed to use, the preferred group is not used. Instead no group is assigned and the submit will subsequently fail the SUBMIT_REQUIREMENT

The manual says that the 3-argument form of the userMap function should yield the user's first group if they don't belong to the preferred group:

String userMap(String mapSetName, String userName, String preferredGroup)

Map an input string using the given mapping set. Returns a string, which is the preferred group if the user is in that group; otherwise it is the first group to which the user belongs, or undefined if the user belongs to no groups.

But this appears to actually result in undefined:

Activity

Show:
Jaime Frey
January 11, 2021, 9:48 PM

Code Review

This looks good.

John (TJ) Knoeller
December 28, 2020, 4:23 PM

The first result is returned when the user preference is undefined, but not when the user preference is a string that does not match the list in the map. This is not what the documentation says, nor is it what the comments in the code say.

Time remaining

0m

Assignee

John (TJ) Knoeller