Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix: identity-org-dal, services and added add group members modal

Piyush Gupta5e0f1d87e356
diff --git a/backend/src/ee/services/group/group-dal.ts b/backend/src/ee/services/group/group-dal.ts
index e1f104f5df..3b240f66b4 100644
--- a/backend/src/ee/services/group/group-dal.ts
+++ b/backend/src/ee/services/group/group-dal.ts
@@ -193,6 +193,7 @@ export const groupDALFactory = (db: TDbClient) => {
.where(`${TableName.Membership}.scopeOrgId`, orgId)
.where(`${TableName.Membership}.scope`, AccessScope.Organization)
.whereNotNull(`${TableName.Membership}.actorIdentityId`)
+ .whereNull(`${TableName.Identity}.projectId`)
.join(TableName.Identity, `${TableName.Membership}.actorIdentityId`, `${TableName.Identity}.id`)
.leftJoin(TableName.IdentityGroupMembership, (bd) => {
bd.on(`${TableName.IdentityGroupMembership}.identityId`, "=", `${TableName.Identity}.id`).andOn(
diff --git a/backend/src/services/identity/identity-org-dal.ts b/backend/src/services/identity/identity-org-dal.ts
index 17de47ad6b..7c92dad289 100644
--- a/backend/src/services/identity/identity-org-dal.ts
+++ b/backend/src/services/identity/identity-org-dal.ts
@@ -682,6 +682,8 @@ export const identityOrgDALFactory = (db: TDbClient) => {
.whereNotNull(`${TableName.Membership}.actorIdentityId`)
.whereNull(`${TableName.Identity}.projectId`)
.whereIn(`${TableName.Identity}.id`, identityIds)
+ .distinctOn(`${TableName.Identity}.id`)
+ .orderBy(`${TableName.Identity}.id`)
.select(selectAllTableCols(TableName.Identity));
return identities;
diff --git a/frontend/src/hooks/api/groups/index.tsx b/frontend/src/hooks/api/groups/index.tsx
index eebe2ccc3a..694ff2b57c 100644
--- a/frontend/src/hooks/api/groups/index.tsx
+++ b/frontend/src/hooks/api/groups/index.tsx
@@ -1,8 +1,15 @@
export {
+ useAddIdentityToGroup,
useAddUserToGroup,
useCreateGroup,
useDeleteGroup,
+ useRemoveIdentityFromGroup,
useRemoveUserFromGroup,
useUpdateGroup
} from "./mutations";
-export { useGetGroupById, useListGroupProjects, useListGroupUsers } from "./queries";
+export {
+ useGetGroupById,
+ useListGroupIdentities,
+ useListGroupProjects,
+ useListGroupUsers
+} from "./queries";
diff --git a/frontend/src/pages/organization/GroupDetailsByIDPage/components/AddGroupMemberModal.tsx b/frontend/src/pages/organization/GroupDetailsByIDPage/components/AddGroupMemberModal.tsx
index b9d1b184c3..3a0a0355e2 100644
--- a/frontend/src/pages/organization/GroupDetailsByIDPage/components/AddGroupMemberModal.tsx
+++ b/frontend/src/pages/organization/GroupDetailsByIDPage/components/AddGroupMemberModal.tsx
@@ -1,39 +1,34 @@
import { useState } from "react";
-import { faMagnifyingGlass, faUsers } from "@fortawesome/free-solid-svg-icons";
+import { faMagnifyingGlass, faServer, faUsers } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+import { twMerge } from "tailwind-merge";
-import { createNotification } from "@app/components/notifications";
-import { OrgPermissionCan } from "@app/components/permissions";
-import {
- Button,
- EmptyState,
- Input,
- Modal,
- ModalContent,
- Pagination,
- Table,
- TableContainer,
- TableSkeleton,
- TBody,
- Td,
- Th,
- THead,
- Tr
-} from "@app/components/v2";
-import { OrgPermissionGroupActions, OrgPermissionSubjects } from "@app/context";
-import { useDebounce, useResetPageHelper } from "@app/hooks";
-import { useAddUserToGroup, useListGroupUsers } from "@app/hooks/api";
-import { EFilterReturnedUsers } from "@app/hooks/api/groups/types";
+import { Button, Input, Modal, ModalContent, Tooltip } from "@app/components/v2";
+import { useDebounce } from "@app/hooks";
import { UsePopUpState } from "@app/hooks/usePopUp";
+import { AddGroupIdentitiesTab, AddGroupUsersTab } from "./AddGroupMemberModalTabs";
+
+enum AddMemberType {
+ Users = "users",
+ MachineIdentities = "machineIdentities"
+}
+
type Props = {
popUp: UsePopUpState<["addGroupMembers"]>;
handlePopUpToggle: (popUpName: keyof UsePopUpState<["addGroupMembers"]>, state?: boolean) => void;
+ isOidcManageGroupMembershipsEnabled: boolean;
};
-export const AddGroupMembersModal = ({ popUp, handlePopUpToggle }: Props) => {
- const [page, setPage] = useState(1);
- const [perPage, setPerPage] = useState(10);
+export const AddGroupMembersModal = ({
+ popUp,
+ handlePopUpToggle,
+ isOidcManageGroupMembershipsEnabled
+}: Props) => {
+ const [addMemberType, setAddMemberType] = useState<AddMemberType>(
+ isOidcManageGroupMembershipsEnabled ? AddMemberType.MachineIdentities : AddMemberType.Users
+ );
+
const [searchMemberFilter, setSearchMemberFilter] = useState("");
const [debouncedSearch] = useDebounce(searchMemberFilter);
@@ -42,47 +37,6 @@ export const AddGroupMembersModal = ({ popUp, handlePopUpToggle }: Props) => {
slug: string;
};
- const offset = (page - 1) * perPage;
- const { data, isPending } = useListGroupUsers({
- id: popUpData?.groupId,
- groupSlug: popUpData?.slug,
- offset,
- limit: perPage,
- search: debouncedSearch,
- filter: EFilterReturnedUsers.NON_MEMBERS
- });
-
- const { totalCount = 0 } = data ?? {};
-
- useResetPageHelper({
- totalCount,
- offset,
- setPage
- });
-
- const { mutateAsync: addUserToGroupMutateAsync } = useAddUserToGroup();
-
- const handleAddMember = async (username: string) => {
- if (!popUpData?.slug) {
- createNotification({
- text: "Some data is missing, please refresh the page and try again",
- type: "error"
- });
- return;
- }
-
- await addUserToGroupMutateAsync({
- groupId: popUpData.groupId,
- username,
- slug: popUpData.slug
- });
-
- createNotification({
- text: "Successfully assigned user to the group",
- type: "success"
- });
- };
-
return (
<Modal
isOpen={popUp?.addGroupMembers?.isOpen}
@@ -97,68 +51,72 @@ export const AddGroupMembersModal = ({ popUp, handlePopUpToggle }: Props) => {
leftIcon={<FontAwesomeIcon icon={faMagnifyingGlass} />}
placeholder="Search members..."
/>
- <TableContainer className="mt-4">
- <Table>
- <THead>
- <Tr>
- <Th>User</Th>
- <Th />
- </Tr>
- </THead>
- <TBody>
- {isPending && <TableSkeleton columns={2} innerKey="group-users" />}
- {!isPending &&
- data?.users?.map(({ id, firstName, lastName, username }) => {
- return (
- <Tr className="items-center" key={`group-user-${id}`}>
- <Td>
- <p>{`${firstName ?? "-"} ${lastName ?? ""}`}</p>
- <p>{username}</p>
- </Td>
- <Td className="flex justify-end">
- <OrgPermissionCan
- I={OrgPermissionGroupActions.Edit}
- a={OrgPermissionSubjects.Groups}
- >
- {(isAllowed) => {
- return (
- <Button
- isLoading={isPending}
- isDisabled={!isAllowed}
- colorSchema="primary"
- variant="outline_bg"
- type="submit"
- onClick={() => handleAddMember(username)}
- >
- Assign
- </Button>
- );
- }}
- </OrgPermissionCan>
- </Td>
- </Tr>
- );
- })}
- </TBody>
- </Table>
- {!isPending && totalCount > 0 && (
- <Pagination
- count={totalCount}
- page={page}
- perPage={perPage}
- onChangePage={(newPage) => setPage(newPage)}
- onChangePerPage={(newPerPage) => setPerPage(newPerPage)}
- />
- )}
- {!isPending && !data?.users?.length && (
- <EmptyState
- title={
- debouncedSearch ? "No users match search" : "All users are already in the group"
+ <div className="mt-4 mb-4 flex items-center justify-center gap-x-2">
+ <div className="flex w-3/4 gap-x-0.5 rounded-md border border-mineshaft-600 bg-mineshaft-800 p-1">
+ <Tooltip
+ className="text-center"
+ content={
+ isOidcManageGroupMembershipsEnabled
+ ? "OIDC Group Membership Mapping Enabled. Assign users to this group in your OIDC provider."
+ : undefined
}
- icon={faUsers}
+ >
+ <div className="flex-1">
+ <Button
+ variant="outline_bg"
+ onClick={() => {
+ setAddMemberType(AddMemberType.Users);
+ }}
+ size="xs"
+ isDisabled={isOidcManageGroupMembershipsEnabled}
+ className={twMerge(
+ "w-full min-w-[2.4rem] rounded border-none hover:bg-mineshaft-600",
+ addMemberType === AddMemberType.Users ? "bg-mineshaft-500" : "bg-transparent"
+ )}
+ >
+ <div className="flex items-center gap-2">
+ <FontAwesomeIcon icon={faUsers} />
+ Users
+ </div>
+ </Button>
+ </div>
+ </Tooltip>
+ <Button
+ variant="outline_bg"
+ onClick={() => {
+ setAddMemberType(AddMemberType.MachineIdentities);
+ }}
+ size="xs"
+ className={twMerge(
+ "min-w-[2.4rem] flex-1 rounded border-none hover:bg-mineshaft-600",
+ addMemberType === AddMemberType.MachineIdentities
+ ? "bg-mineshaft-500"
+ : "bg-transparent"
+ )}
+ >
+ <div className="flex items-center gap-2">
+ <FontAwesomeIcon icon={faServer} />
+ Machine Identities
+ </div>
+ </Button>
+ </div>
+ </div>
+ {addMemberType === AddMemberType.Users &&
+ popUpData &&
+ !isOidcManageGroupMembershipsEnabled && (
+ <AddGroupUsersTab
+ groupId={popUpData.groupId}
+ groupSlug={popUpData.slug}
+ search={debouncedSearch}
/>
)}
- </TableContainer>
+ {addMemberType === AddMemberType.MachineIdentities && popUpData && (
+ <AddGroupIdentitiesTab
+ groupId={popUpData.groupId}
+ groupSlug={popUpData.slug}
+ search={debouncedSearch}
+ />
+ )}
</ModalContent>
</Modal>
);
diff --git a/frontend/src/pages/organization/GroupDetailsByIDPage/components/AddGroupMemberModalTabs/AddGroupIdentitiesTab.tsx b/frontend/src/pages/organization/GroupDetailsByIDPage/components/AddGroupMemberModalTabs/AddGroupIdentitiesTab.tsx
new file mode 100644
index 0000000000..6b8510d0b0
--- /dev/null
+++ b/frontend/src/pages/organization/GroupDetailsByIDPage/components/AddGroupMemberModalTabs/AddGroupIdentitiesTab.tsx
@@ -0,0 +1,140 @@
+import { useState } from "react";
+import { faServer } from "@fortawesome/free-solid-svg-icons";
+
+import { createNotification } from "@app/components/notifications";
+import { OrgPermissionCan } from "@app/components/permissions";
+import {
+ Button,
+ EmptyState,
+ Pagination,
+ Table,
+ TableContainer,
+ TableSkeleton,
+ TBody,
+ Td,
+ Th,
+ THead,
+ Tr
+} from "@app/components/v2";
+import { OrgPermissionGroupActions, OrgPermissionSubjects } from "@app/context";
+import { useResetPageHelper } from "@app/hooks";
+import { useAddIdentityToGroup, useListGroupIdentities } from "@app/hooks/api";
+import { EFilterReturnedIdentities, TGroupIdentity } from "@app/hooks/api/groups/types";
+
+type Props = {
+ groupId: string;
+ groupSlug: string;
+ search: string;
+};
+
+export const AddGroupIdentitiesTab = ({ groupId, groupSlug, search }: Props) => {
+ const [page, setPage] = useState(1);
+ const [perPage, setPerPage] = useState(10);
+
+ const offset = (page - 1) * perPage;
+ const { data, isPending } = useListGroupIdentities({
+ id: groupId,
+ groupSlug,
+ offset,
+ limit: perPage,
+ search,
+ filter: EFilterReturnedIdentities.NON_ASSIGNED_IDENTITIES
+ });
+
+ const { totalCount = 0 } = data ?? {};
+
+ useResetPageHelper({
+ totalCount,
+ offset,
+ setPage
+ });
+
+ const { mutateAsync: addIdentityToGroupMutateAsync } = useAddIdentityToGroup();
+
+ const handleAddIdentity = async (identityId: string) => {
+ if (!groupSlug) {
+ createNotification({
+ text: "Some data is missing, please refresh the page and try again",
+ type: "error"
+ });
+ return;
+ }
+
+ await addIdentityToGroupMutateAsync({
+ groupId,
+ identityId,
+ slug: groupSlug
+ });
+
+ createNotification({
+ text: "Successfully assigned machine identity to the group",
+ type: "success"
+ });
+ };
+
+ return (
+ <TableContainer className="mt-4">
+ <Table>
+ <THead>
+ <Tr>
+ <Th>Machine Identity</Th>
+ <Th />
+ </Tr>
+ </THead>
+ <TBody>
+ {isPending && <TableSkeleton columns={2} innerKey="group-identities" />}
+ {!isPending &&
+ data?.identities?.map((identity: TGroupIdentity) => {
+ return (
+ <Tr className="items-center" key={`group-identity-${identity.id}`}>
+ <Td>
+ <p>{identity.name}</p>
+ </Td>
+ <Td className="flex justify-end">
+ <OrgPermissionCan
+ I={OrgPermissionGroupActions.Edit}
+ a={OrgPermissionSubjects.Groups}
+ >
+ {(isAllowed) => {
+ return (
+ <Button
+ isLoading={isPending}
+ isDisabled={!isAllowed}
+ colorSchema="primary"
+ variant="outline_bg"
+ type="submit"
+ onClick={() => handleAddIdentity(identity.id)}
+ >
+ Assign
+ </Button>
+ );
+ }}
+ </OrgPermissionCan>
+ </Td>
+ </Tr>
+ );
+ })}
+ </TBody>
+ </Table>
+ {!isPending && totalCount > 0 && (
+ <Pagination
+ count={totalCount}
+ page={page}
+ perPage={perPage}
+ onChangePage={(newPage) => setPage(newPage)}
+ onChangePerPage={(newPerPage) => setPerPage(newPerPage)}
+ />
+ )}
+ {!isPending && !data?.identities?.length && (
+ <EmptyState
+ title={
+ search
+ ? "No machine identities match search"
+ : "All machine identities are already in the group"
+ }
+ icon={faServer}
+ />
+ )}
+ </TableContainer>
+ );
+};
diff --git a/frontend/src/pages/organization/GroupDetailsByIDPage/components/AddGroupMemberModalTabs/AddGroupUsersTab.tsx b/frontend/src/pages/organization/GroupDetailsByIDPage/components/AddGroupMemberModalTabs/AddGroupUsersTab.tsx
new file mode 100644
index 0000000000..19408fcd67
--- /dev/null
+++ b/frontend/src/pages/organization/GroupDetailsByIDPage/components/AddGroupMemberModalTabs/AddGroupUsersTab.tsx
@@ -0,0 +1,137 @@
+import { useState } from "react";
+import { faUsers } from "@fortawesome/free-solid-svg-icons";
+
+import { createNotification } from "@app/components/notifications";
+import { OrgPermissionCan } from "@app/components/permissions";
+import {
+ Button,
+ EmptyState,
+ Pagination,
+ Table,
+ TableContainer,
+ TableSkeleton,
+ TBody,
+ Td,
+ Th,
+ THead,
+ Tr
+} from "@app/components/v2";
+import { OrgPermissionGroupActions, OrgPermissionSubjects } from "@app/context";
+import { useResetPageHelper } from "@app/hooks";
+import { useAddUserToGroup, useListGroupUsers } from "@app/hooks/api";
+import { EFilterReturnedUsers } from "@app/hooks/api/groups/types";
+
+type Props = {
+ groupId: string;
+ groupSlug: string;
+ search: string;
+};
+
+export const AddGroupUsersTab = ({ groupId, groupSlug, search }: Props) => {
+ const [page, setPage] = useState(1);
+ const [perPage, setPerPage] = useState(10);
+
+ const offset = (page - 1) * perPage;
+ const { data, isPending } = useListGroupUsers({
+ id: groupId,
+ groupSlug,
+ offset,
+ limit: perPage,
+ search,
+ filter: EFilterReturnedUsers.NON_MEMBERS
+ });
+
+ const { totalCount = 0 } = data ?? {};
+
+ useResetPageHelper({
+ totalCount,
+ offset,
+ setPage
+ });
+
+ const { mutateAsync: addUserToGroupMutateAsync } = useAddUserToGroup();
+
+ const handleAddUser = async (username: string) => {
+ if (!groupSlug) {
+ createNotification({
+ text: "Some data is missing, please refresh the page and try again",
+ type: "error"
+ });
+ return;
+ }
+
+ await addUserToGroupMutateAsync({
+ groupId,
+ username,
+ slug: groupSlug
+ });
+
+ createNotification({
+ text: "Successfully assigned user to the group",
+ type: "success"
+ });
+ };
+
+ return (
+ <TableContainer className="mt-4">
+ <Table>
+ <THead>
+ <Tr>
+ <Th>User</Th>
+ <Th />
+ </Tr>
+ </THead>
+ <TBody>
+ {isPending && <TableSkeleton columns={2} innerKey="group-users" />}
+ {!isPending &&
+ data?.users?.map(({ id, firstName, lastName, username }) => {
+ return (
+ <Tr className="items-center" key={`group-user-${id}`}>
+ <Td>
+ <p>{`${firstName ?? "-"} ${lastName ?? ""}`}</p>
+ <p>{username}</p>
+ </Td>
+ <Td className="flex justify-end">
+ <OrgPermissionCan
+ I={OrgPermissionGroupActions.Edit}
+ a={OrgPermissionSubjects.Groups}
+ >
+ {(isAllowed) => {
+ return (
+ <Button
+ isLoading={isPending}
+ isDisabled={!isAllowed}
+ colorSchema="primary"
+ variant="outline_bg"
+ type="submit"
+ onClick={() => handleAddUser(username)}
+ >
+ Assign
+ </Button>
+ );
+ }}
+ </OrgPermissionCan>
+ </Td>
+ </Tr>
+ );
+ })}
+ </TBody>
+ </Table>
+ {!isPending && totalCount > 0 && (
+ <Pagination
+ count={totalCount}
+ page={page}
+ perPage={perPage}
+ onChangePage={(newPage) => setPage(newPage)}
+ onChangePerPage={(newPerPage) => setPerPage(newPerPage)}
+ />
+ )}
+ {!isPending && !data?.users?.length && (
+ <EmptyState
+ title={search ? "No users match search" : "All users are already in the group"}
+ icon={faUsers}
+ />
+ )}
+ </TableContainer>
+ );
+};
diff --git a/frontend/src/pages/organization/GroupDetailsByIDPage/components/AddGroupMemberModalTabs/index.tsx b/frontend/src/pages/organization/GroupDetailsByIDPage/components/AddGroupMemberModalTabs/index.tsx
new file mode 100644
index 0000000000..e40c6da6b7
--- /dev/null
+++ b/frontend/src/pages/organization/GroupDetailsByIDPage/components/AddGroupMemberModalTabs/index.tsx
@@ -0,0 +1,2 @@
+export { AddGroupIdentitiesTab } from "./AddGroupIdentitiesTab";
+export { AddGroupUsersTab } from "./AddGroupUsersTab";
diff --git a/frontend/src/pages/organization/GroupDetailsByIDPage/components/GroupMembersSection/GroupMembersSection.tsx b/frontend/src/pages/organization/GroupDetailsByIDPage/components/GroupMembersSection/GroupMembersSection.tsx
index 024bc54d64..8f7cfcae73 100644
--- a/frontend/src/pages/organization/GroupDetailsByIDPage/components/GroupMembersSection/GroupMembersSection.tsx
+++ b/frontend/src/pages/organization/GroupDetailsByIDPage/components/GroupMembersSection/GroupMembersSection.tsx
@@ -3,7 +3,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { createNotification } from "@app/components/notifications";
import { OrgPermissionCan } from "@app/components/permissions";
-import { DeleteActionModal, IconButton, Tooltip } from "@app/components/v2";
+import { DeleteActionModal, IconButton } from "@app/components/v2";
import { OrgPermissionGroupActions, OrgPermissionSubjects, useOrganization } from "@app/context";
import { useOidcManageGroupMembershipsEnabled, useRemoveUserFromGroup } from "@app/hooks/api";
import { usePopUp } from "@app/hooks/usePopUp";
@@ -46,34 +46,25 @@ export const GroupMembersSection = ({ groupId, groupSlug }: Props) => {
return (
<div className="w-full rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">
<div className="flex items-center justify-between border-b border-mineshaft-400 pb-4">
- <h3 className="text-lg font-medium text-mineshaft-100">Members</h3>
+ <h3 className="text-lg font-medium text-mineshaft-100">Group Members</h3>
<OrgPermissionCan I={OrgPermissionGroupActions.Edit} a={OrgPermissionSubjects.Groups}>
{(isAllowed) => (
- <Tooltip
- className="text-center"
- content={
- isOidcManageGroupMembershipsEnabled
- ? "OIDC Group Membership Mapping Enabled. Assign users to this group in your OIDC provider."
- : undefined
- }
- >
- <div className="mb-4 flex items-center justify-center">
- <IconButton
- isDisabled={isOidcManageGroupMembershipsEnabled || !isAllowed}
- ariaLabel="copy icon"
- variant="plain"
- className="group relative"
- onClick={() => {
- handlePopUpOpen("addGroupMembers", {
- groupId,
- slug: groupSlug
- });
- }}
- >
- <FontAwesomeIcon icon={faPlus} />
- </IconButton>
- </div>
- </Tooltip>
+ <div className="mb-4 flex items-center justify-center">
+ <IconButton
+ isDisabled={!isAllowed}
+ ariaLabel="copy icon"
+ variant="plain"
+ className="group relative"
+ onClick={() => {
+ handlePopUpOpen("addGroupMembers", {
+ groupId,
+ slug: groupSlug
+ });
+ }}
+ >
+ <FontAwesomeIcon icon={faPlus} />
+ </IconButton>
+ </div>
)}
</OrgPermissionCan>
</div>
@@ -84,7 +75,11 @@ export const GroupMembersSection = ({ groupId, groupSlug }: Props) => {
handlePopUpOpen={handlePopUpOpen}
/>
</div>
- <AddGroupMembersModal popUp={popUp} handlePopUpToggle={handlePopUpToggle} />
+ <AddGroupMembersModal
+ popUp={popUp}
+ handlePopUpToggle={handlePopUpToggle}
+ isOidcManageGroupMembershipsEnabled={isOidcManageGroupMembershipsEnabled}
+ />
<DeleteActionModal
isOpen={popUp.removeMemberFromGroup.isOpen}
title={`Are you sure you want to remove ${
diff --git a/frontend/src/pages/organization/GroupDetailsByIDPage/components/GroupProjectsSection/GroupProjectsSection.tsx b/frontend/src/pages/organization/GroupDetailsByIDPage/components/GroupProjectsSection/GroupProjectsSection.tsx
index d6997c6cb7..1ef653dc2a 100644
--- a/frontend/src/pages/organization/GroupDetailsByIDPage/components/GroupProjectsSection/GroupProjectsSection.tsx
+++ b/frontend/src/pages/organization/GroupDetailsByIDPage/components/GroupProjectsSection/GroupProjectsSection.tsx
@@ -41,7 +41,7 @@ export const GroupProjectsSection = ({ groupId, groupSlug }: Props) => {
return (
<div className="w-full rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">
<div className="flex items-center justify-between border-b border-mineshaft-400 pb-4">
- <h3 className="text-lg font-medium text-mineshaft-100">Projects</h3>
+ <h3 className="text-lg font-medium text-mineshaft-100">Group Projects</h3>
<OrgPermissionCan I={OrgPermissionGroupActions.Edit} a={OrgPermissionSubjects.Groups}>
{(isAllowed) => (
<IconButton