mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-16 21:37:59 +00:00
Finish preliminary delete user, organization, refactor delete project, create org page
This commit is contained in:
@@ -63,10 +63,12 @@ export const useGetRoles = ({ orgId, workspaceId }: TGetRolesDTO) =>
|
||||
});
|
||||
|
||||
const getUserOrgPermissions = async ({ orgId }: TGetUserOrgPermissionsDTO) => {
|
||||
if (orgId === "") return [];
|
||||
|
||||
const { data } = await apiRequest.get<{
|
||||
data: { permissions: PackRule<RawRuleOf<MongoAbility<OrgPermissionSet>>>[] };
|
||||
}>(`/api/v1/roles/organization/${orgId}/permissions`, {});
|
||||
|
||||
|
||||
return data.data.permissions;
|
||||
};
|
||||
|
||||
@@ -74,7 +76,7 @@ export const useGetUserOrgPermissions = ({ orgId }: TGetUserOrgPermissionsDTO) =
|
||||
useQuery({
|
||||
queryKey: roleQueryKeys.getUserOrgPermissions({ orgId }),
|
||||
queryFn: () => getUserOrgPermissions({ orgId }),
|
||||
enabled: Boolean(orgId),
|
||||
// enabled: Boolean(orgId),
|
||||
select: (data) => {
|
||||
const rule = unpackRules<RawRuleOf<MongoAbility<OrgPermissionSet>>>(data);
|
||||
const ability = createMongoAbility<OrgPermissionSet>(rule, { conditionsMatcher });
|
||||
|
||||
Reference in New Issue
Block a user