Remove admin only pages from non-admin menu
This commit is contained in:
parent
d7aae52657
commit
afd0936fd7
|
@ -20,9 +20,17 @@
|
||||||
let userInfoModal
|
let userInfoModal
|
||||||
let changePasswordModal
|
let changePasswordModal
|
||||||
|
|
||||||
const menu = [
|
$: menu = buildMenu($auth.isAdmin)
|
||||||
{ title: "Apps", href: "/builder/portal/apps" },
|
|
||||||
{ title: "Users", href: "/builder/portal/manage/users", heading: "Manage" },
|
const buildMenu = admin => {
|
||||||
|
let menu = [{ title: "Apps", href: "/builder/portal/apps" }]
|
||||||
|
if (admin) {
|
||||||
|
menu = menu.concat([
|
||||||
|
{
|
||||||
|
title: "Users",
|
||||||
|
href: "/builder/portal/manage/users",
|
||||||
|
heading: "Manage",
|
||||||
|
},
|
||||||
{ title: "Auth", href: "/builder/portal/manage/auth" },
|
{ title: "Auth", href: "/builder/portal/manage/auth" },
|
||||||
{ title: "Email", href: "/builder/portal/manage/email" },
|
{ title: "Email", href: "/builder/portal/manage/email" },
|
||||||
{
|
{
|
||||||
|
@ -30,8 +38,22 @@
|
||||||
href: "/builder/portal/settings/organisation",
|
href: "/builder/portal/settings/organisation",
|
||||||
heading: "Settings",
|
heading: "Settings",
|
||||||
},
|
},
|
||||||
{ title: "Theming", href: "/builder/portal/settings/theming" },
|
{
|
||||||
]
|
title: "Theming",
|
||||||
|
href: "/builder/portal/settings/theming",
|
||||||
|
},
|
||||||
|
])
|
||||||
|
} else {
|
||||||
|
menu = menu.concat([
|
||||||
|
{
|
||||||
|
title: "Theming",
|
||||||
|
href: "/builder/portal/settings/theming",
|
||||||
|
heading: "Settings",
|
||||||
|
},
|
||||||
|
])
|
||||||
|
}
|
||||||
|
return menu
|
||||||
|
}
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
// Prevent non-builders from accessing the portal
|
// Prevent non-builders from accessing the portal
|
||||||
|
|
Loading…
Reference in New Issue