Commit 2945a059 authored by Mahmoud Aglan's avatar Mahmoud Aglan

Fix build: export usePermissions from store.jsx

parent 9403955f
......@@ -81,4 +81,13 @@ export function useApp() {
const ctx = useContext(AppContext);
if (!ctx) throw new Error("useApp must be used within AppProvider");
return ctx;
}
export function usePermissions() {
const { state } = useApp();
// Provide defaults if user permissions aren't loaded yet
return state.user?.permissions || {
can_use_knowledge_base: true,
can_use_gitlab: true,
};
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment