mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 08:27:22 +00:00
Feat: Helper function to check for project roles
This commit is contained in:
@@ -56,5 +56,7 @@ export const useProjectPermission = () => {
|
|||||||
throw new Error("useProjectPermission to be used within <ProjectPermissionContext>");
|
throw new Error("useProjectPermission to be used within <ProjectPermissionContext>");
|
||||||
}
|
}
|
||||||
|
|
||||||
return ctx;
|
const hasProjectRole = (role: string) => ctx?.membership?.roles?.includes(role) || false;
|
||||||
|
|
||||||
|
return { ...ctx, hasProjectRole };
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user