From a192ea0caa9e13caea71e6933b2f3df6d10a7082 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Wed, 1 Mar 2023 14:48:10 +0000 Subject: [PATCH 1/2] Only allow admins to access audit logs --- packages/builder/src/stores/portal/menu.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/builder/src/stores/portal/menu.js b/packages/builder/src/stores/portal/menu.js index 56956fc330..3ffb62d881 100644 --- a/packages/builder/src/stores/portal/menu.js +++ b/packages/builder/src/stores/portal/menu.js @@ -75,11 +75,15 @@ export const menu = derived([admin, auth], ([$admin, $auth]) => { title: "Usage", href: "/builder/portal/account/usage", }, - { - title: "Audit Logs", - href: "/builder/portal/account/auditLogs", - }, + ] + if ($auth.isAdmin) { + accountSubPages.push( + { + title: "Audit Logs", + href: "/builder/portal/account/auditLogs", + }) + } if ($admin.cloud && $auth?.user?.accountPortalAccess) { accountSubPages.push({ title: "Upgrade", From 692d10d4becdb683463e6ea55a81866ff0b89ed0 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Wed, 1 Mar 2023 14:54:00 +0000 Subject: [PATCH 2/2] lint --- packages/builder/src/stores/portal/menu.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/builder/src/stores/portal/menu.js b/packages/builder/src/stores/portal/menu.js index 3ffb62d881..d791a4ac91 100644 --- a/packages/builder/src/stores/portal/menu.js +++ b/packages/builder/src/stores/portal/menu.js @@ -75,14 +75,12 @@ export const menu = derived([admin, auth], ([$admin, $auth]) => { title: "Usage", href: "/builder/portal/account/usage", }, - ] if ($auth.isAdmin) { - accountSubPages.push( - { - title: "Audit Logs", - href: "/builder/portal/account/auditLogs", - }) + accountSubPages.push({ + title: "Audit Logs", + href: "/builder/portal/account/auditLogs", + }) } if ($admin.cloud && $auth?.user?.accountPortalAccess) { accountSubPages.push({