1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-24 15:49:42 +02:00

add avanced-only

This commit is contained in:
Kuchenpirat 2024-01-31 11:56:15 +00:00
parent 19e776a772
commit 8d2d571683
2 changed files with 11 additions and 1 deletions

View file

@ -0,0 +1,11 @@
interface AdvancedOnlyRedirectParams {
$auth: any
redirect: (path: string) => void
}
export default function ({ $auth, redirect }: AdvancedOnlyRedirectParams) {
// If the user is not allowed to organize redirect to the home page
if (!$auth.user.advanced) {
console.warn("User is not allowed to access advanced features");
return redirect("/")
}
}