When the staff accessing holdings in the holdings editor do not have the
VIEW_USER permission at a level sufficient to display the creator/editor
of a set of items, display the ID of the user instead of attempting and
failing to display the username, which causes a page rendering error.
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Mary Llewellyn <mllewell@biblio.org>
Signed-off-by: Michele Morgan <mmorgan@noblenet.org>
case 'editor':
case 'creator':
- return value.usrname();
+ // VIEW_USER permission may be too narrow. If so,
+ // just display the user ID instead of the username.
+ return typeof value === 'object' ? value.usrname() : value;
case 'circ_lib':
return this.org.get(value).shortname();