From 75817c01901cd92c4ccaf95bc7be3124aecc244d Mon Sep 17 00:00:00 2001 From: Shaun Turner Date: Thu, 11 Apr 2024 14:01:56 +0100 Subject: [PATCH] #2925 fix to non existent permissionIdx property --- js/services/AuthAPI.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/services/AuthAPI.js b/js/services/AuthAPI.js index cd88bbb32..de5864a5c 100644 --- a/js/services/AuthAPI.js +++ b/js/services/AuthAPI.js @@ -78,7 +78,13 @@ define(function(require, exports) { url: config.api.url + 'user/me', method: 'GET', success: function (info, textStatus, jqXHR) { - permissions(info.permissionIdx); // read from permission index of User info + const permissionIdx = info.permissions.reduce(function(rv, x) { + key = x.permission.split(":")[0]; + (rv[key] = rv[key] || []).push(x.permission); + return rv; + }, {}); + + permissions(permissionIdx); // read from permission index of User info subject(info.login); authProvider(jqXHR.getResponseHeader('x-auth-provider')); fullName(info.name ? info.name : info.login);