mirror of
https://github.com/Infisical/infisical.git
synced 2026-05-02 03:02:03 -04: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