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

Fix build: export usePermissions from store.jsx

parent 9403955f
...@@ -82,3 +82,12 @@ export function useApp() { ...@@ -82,3 +82,12 @@ export function useApp() {
if (!ctx) throw new Error("useApp must be used within AppProvider"); if (!ctx) throw new Error("useApp must be used within AppProvider");
return ctx; 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