LP#1990306: avoid VIEW_USER perm lookup on egPatronApp startup when we have a null... user/jeffdavis/lp1990306-null-authtoken-perm-lookup
authorJeff Davis <jeff.davis@bc.libraries.coop>
Tue, 18 Oct 2022 19:42:26 +0000 (12:42 -0700)
committerJeff Davis <jeff.davis@bc.libraries.coop>
Tue, 18 Oct 2022 19:42:26 +0000 (12:42 -0700)
Signed-off-by: Jeff Davis <jeff.davis@bc.libraries.coop>
Open-ILS/web/js/ui/default/staff/circ/patron/app.js

index 7914bca..a0501fd 100644 (file)
@@ -70,6 +70,7 @@ angular.module('egPatronApp', ['ngRoute', 'ui.bootstrap', 'egUserBucketMod',
             // FIXME: the following is really just for PatronMessagesCtrl
             // and PatronCtrl, so we could refactor to avoid calling it
             // for every controller
+            if (!egCore.auth.token()) return go_promise;
             return egCore.perm.hasPermFullPathAt('VIEW_USER')
             .then(function(orgList) {
                 hasPermAt['VIEW_USER'] = orgList;