diff --git a/frontend/src/pages/organization/IdentityDetailsByIDPage/components/ViewIdentityAuth/ViewIdentityAuth.tsx b/frontend/src/pages/organization/IdentityDetailsByIDPage/components/ViewIdentityAuth/ViewIdentityAuth.tsx index 93fdc7b8b2..d6e322487f 100644 --- a/frontend/src/pages/organization/IdentityDetailsByIDPage/components/ViewIdentityAuth/ViewIdentityAuth.tsx +++ b/frontend/src/pages/organization/IdentityDetailsByIDPage/components/ViewIdentityAuth/ViewIdentityAuth.tsx @@ -1,8 +1,10 @@ +import { subject } from "@casl/ability"; import { useParams } from "@tanstack/react-router"; import { EllipsisIcon, LockIcon } from "lucide-react"; import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal"; import { createNotification } from "@app/components/notifications"; +import { VariablePermissionCan } from "@app/components/permissions"; import { DeleteActionModal, Modal, ModalContent, Tooltip } from "@app/components/v2"; import { Badge, @@ -16,7 +18,13 @@ import { UnstableDropdownMenuTrigger, UnstableIconButton } from "@app/components/v3"; -import { useOrganization } from "@app/context"; +import { + OrgPermissionIdentityActions, + OrgPermissionSubjects, + ProjectPermissionIdentityActions, + ProjectPermissionSub, + useOrganization +} from "@app/context"; import { usePopUp } from "@app/hooks"; import { IdentityAuthMethod, @@ -190,23 +198,61 @@ export const Content = ({ - { - e.stopPropagation(); - handlePopUpOpen("identityAuthMethod", authMethod); - }} + - Edit Auth Method - - { - e.stopPropagation(); - handlePopUpOpen("revokeAuthMethod", authMethod); - }} - variant="danger" + {(isAllowed) => ( + { + e.stopPropagation(); + handlePopUpOpen("identityAuthMethod", authMethod); + }} + > + Edit Auth Method + + )} + + - Remove Auth Method - + {(isAllowed) => ( + { + e.stopPropagation(); + handlePopUpOpen("revokeAuthMethod", authMethod); + }} + variant="danger" + > + Remove Auth Method + + )} +