1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-24 15:49:42 +02:00
mealie/frontend/middleware/can-organize-only.ts
2024-01-31 10:33:05 +00:00

12 lines
402 B
TypeScript

interface CanOrganizeRedirectParams {
$auth: any
redirect: (path: string) => void
}
export default function ({ $auth, redirect }: CanOrganizeRedirectParams) {
console.log($auth.user);
// If the user is not allowed to organize redirect to the home page
if (!$auth.user.canOrganize) {
console.warn("User is not allowed to organize data");
return redirect("/")
}
}