From 9f77439c30524029e01ad60fc5fb28f3f596d097 Mon Sep 17 00:00:00 2001 From: shaun turner Date: Thu, 11 Apr 2024 10:12:47 +0100 Subject: [PATCH] #2925 additional logging to attempt to identify specific permissions issues we're experiencing --- js/services/AuthAPI.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/js/services/AuthAPI.js b/js/services/AuthAPI.js index cd88bbb32..be5796181 100644 --- a/js/services/AuthAPI.js +++ b/js/services/AuthAPI.js @@ -219,24 +219,31 @@ define(function(require, exports) { var isPermitted = function (permission) { if (!config.userAuthenticationEnabled) { + console.warn("User Authentication is not enabled"); return true; } - if (!permissions()) return false; - + if (!permissions()) { + console.error("permissions is not populated."); + return false; + } firstPerm = permission.split(":")[0]; var etalons = [...(permissions()["*"] || []), ...(permissions()[firstPerm]||[])]; if (!etalons) { + console.error("etalons is not populated") return false; } for (var i = 0; i < etalons.length; i++) { if (checkPermission(permission, etalons[i])) { + console.info(`User has permission: ${permission}`) return true; } } + console.warn(`${permission} is not present in etalons: ${etalons}`); + return false; };