Working on role in workspace.

This commit is contained in:
charles-gauthereau
2024-12-31 10:54:18 +01:00
parent e1a7ca8558
commit 6f75079a40
29 changed files with 464 additions and 124 deletions
@@ -0,0 +1,16 @@
import React from "react";
import {currentUser} from "@/auth/current-user";
import {notFound} from "next/navigation";
export default async function Layout({children}: { children: React.ReactNode }) {
const user = await currentUser()
if(user.role != "admin"){
notFound()
}
return (
<>
{children}
</>
)
}