[TSM.ID].[11031972] PXE : Platform X Ecosystem I [118 Module -LIVE-]
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
"use client";
|
||||
|
||||
import { createContext, useContext } from "react";
|
||||
|
||||
interface IAMContextType {
|
||||
isClientRole: boolean;
|
||||
permissions: Record<string, string[]> | null;
|
||||
defaultClientPermissions: Record<string, string[]>;
|
||||
canSee: (modName: string) => boolean;
|
||||
}
|
||||
|
||||
export const IAMContext = createContext<IAMContextType | null>(null);
|
||||
|
||||
export const useIAM = () => {
|
||||
const context = useContext(IAMContext);
|
||||
if (!context) {
|
||||
throw new Error("useIAM must be used within an IAMProvider");
|
||||
}
|
||||
return context;
|
||||
};
|
||||
Reference in New Issue
Block a user