From: Bill Erickson Date: Mon, 11 Jul 2022 14:58:40 +0000 (-0400) Subject: LP1956619 Holdings editor sanity check for VIEW_USER perm X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7c6aa859826b61bc58cf692af8665374c6222ed3;p=working%2FEvergreen.git LP1956619 Holdings editor sanity check for VIEW_USER perm 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 Signed-off-by: Mary Llewellyn Signed-off-by: Michele Morgan --- diff --git a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts index 17e8c87289..729a62e3d5 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts @@ -223,7 +223,9 @@ export class CopyAttrsComponent implements OnInit, AfterViewInit { 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();