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=42088efd917b6708945e2634203410e3d72d6449;p=Evergreen.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 e016e511f0..e5f08bebdf 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 @@ -224,7 +224,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();