Ensure unauthorised users cannot view pages they should not be able to

This commit is contained in:
Andrew Kingston 2023-01-23 13:47:36 +00:00
parent a10f7b3890
commit 8a90862c8b
3 changed files with 9 additions and 6 deletions

View File

@ -1,10 +1,11 @@
<script> <script>
import { isActive } from "@roxi/routify" import { goto, isActive } from "@roxi/routify"
import { Page } from "@budibase/bbui" import { Page } from "@budibase/bbui"
import { Content, SideNav, SideNavItem } from "components/portal/page" import { Content, SideNav, SideNavItem } from "components/portal/page"
import { menu } from "stores/portal" import { menu } from "stores/portal"
$: pages = $menu.find(x => x.title === "Account").subPages $: pages = $menu.find(x => x.title === "Account")?.subPages || []
$: !pages.length && $goto("../")
</script> </script>
<Page> <Page>

View File

@ -1,11 +1,12 @@
<script> <script>
import { isActive } from "@roxi/routify" import { goto, isActive } from "@roxi/routify"
import { Page } from "@budibase/bbui" import { Page } from "@budibase/bbui"
import { Content, SideNav, SideNavItem } from "components/portal/page" import { Content, SideNav, SideNavItem } from "components/portal/page"
import { menu } from "stores/portal" import { menu } from "stores/portal"
$: wide = $isActive("./email/:template") $: wide = $isActive("./email/:template")
$: pages = $menu.find(x => x.title === "Settings").subPages $: pages = $menu.find(x => x.title === "Settings")?.subPages || []
$: !pages.length && $goto("../")
</script> </script>
<Page> <Page>

View File

@ -1,11 +1,12 @@
<script> <script>
import { Page } from "@budibase/bbui" import { Page } from "@budibase/bbui"
import { SideNav, SideNavItem, Content } from "components/portal/page" import { SideNav, SideNavItem, Content } from "components/portal/page"
import { isActive } from "@roxi/routify" import { isActive, goto } from "@roxi/routify"
import { menu } from "stores/portal" import { menu } from "stores/portal"
$: wide = $isActive("./users/index") || $isActive("./groups/index") $: wide = $isActive("./users/index") || $isActive("./groups/index")
$: pages = $menu.find(x => x.title === "Users").subPages $: pages = $menu.find(x => x.title === "Users")?.subPages || []
$: !pages.length && $goto("../")
</script> </script>
<Page> <Page>