From f34bff4295ce69fcc8ec37d11581a50f16bb10e4 Mon Sep 17 00:00:00 2001 From: TyroneAEM <147942284+TyroneAEM@users.noreply.github.com> Date: Fri, 5 Apr 2024 15:46:32 -0500 Subject: [PATCH] ASSETS-88895 : Updated function getQuickLinkConfig() to still work if the row.Group is undefined or does not exist (#60) * security.js updated function checkUserAccess for users that are members of the imsUserGroup, that if a page has the property reporting-access then access to the page is only granted if the user is member of te group defined by the property imsReportingGroup in the file admin-config.xlsx site-config.js : Updated the function getQuickLinkConfig to show the quick link to users who are members of the new column Group in shared-quicklinks tab of file site-config.xlsx * securiity.js : Deleted function isReportingAccessPage() as it is not needed any more. Updated function checkUserAccess() : Update code for non public pages, check if the current page path is in the pages returned by the function getQuickLinks. If it does not exist in quick links, then the user does not have access to the page. The functionQuickLinks already has logic to check if a page is only accessible by users of a page group. Renamed function checkGroupAccess(adminConfigGroupPropertyName) to checkPageGroupAccess(adminConfigGroupPropertyName) * Updated function getQuickLinkConfig() to still work if the row.Group is undefined or does not exist --- scripts/site-config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/site-config.js b/scripts/site-config.js index c0bc0603..79f1e876 100644 --- a/scripts/site-config.js +++ b/scripts/site-config.js @@ -288,7 +288,7 @@ export async function getQuickLinkConfig() { const response = await getConfig('site-config.json'); for (const row of response.quicklinks?.data || []) { - if (row.Title && row.Page && row.Group == '') { + if (row.Title && row.Page && (row.Group ?? '') === '') { result.push({ title: row.Title, page: row.Page,