mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +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>");
|
||||
}
|
||||
|
||||
return ctx;
|
||||
const hasProjectRole = (role: string) => ctx?.membership?.roles?.includes(role) || false;
|
||||
|
||||
return { ...ctx, hasProjectRole };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user