mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-25 08:09:41 +02:00
manage-data pages
This commit is contained in:
parent
02997cd36e
commit
19e776a772
10 changed files with 32 additions and 14 deletions
12
frontend/middleware/can-organize-only.ts
Normal file
12
frontend/middleware/can-organize-only.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
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("/")
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue