1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-23 15:19:41 +02:00
mealie/frontend/middleware/can-manage-household-only.ts

12 lines
385 B
TypeScript
Raw Normal View History

interface CanManageRedirectParams {
$auth: any
redirect: (path: string) => void
}
export default function ({ $auth, redirect }: CanManageRedirectParams) {
// If the user is not allowed to manage group settings redirect to the home page
if (!$auth.user?.canManageHousehold) {
console.warn("User is not allowed to manage household settings");
return redirect("/");
}
}