From 3b54ad2df40c4f517d95f48337d6802401fd3531 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 11 Jul 2022 10:58:40 -0400 Subject: [PATCH] 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 --- Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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(); -- 2.11.0