@@ -136,40 +143,56 @@ export const IdentityTokenAuthTokensTable = ({ tokens, identityId }: Props) => {
|
-
- {
- handlePopUpOpen("token", {
- identityId,
- tokenId: id,
- name
- });
- }}
- size="xs"
- variant="plain"
- ariaLabel="Edit token"
- >
-
-
-
+
+ {(isAllowed) => (
+
+ {
+ handlePopUpOpen("token", {
+ identityId,
+ tokenId: id,
+ name
+ });
+ }}
+ size="xs"
+ variant="plain"
+ ariaLabel="Edit token"
+ >
+
+
+
+ )}
+
{!isAccessTokenRevoked && (
-
- {
- handlePopUpOpen("revokeToken", {
- identityId,
- tokenId: id,
- name
- });
- }}
- size="xs"
- colorSchema="danger"
- variant="plain"
- ariaLabel="Revoke token"
- >
-
-
-
+
+ {(isAllowed) => (
+
+ {
+ handlePopUpOpen("revokeToken", {
+ identityId,
+ tokenId: id,
+ name
+ });
+ }}
+ size="xs"
+ colorSchema="danger"
+ variant="plain"
+ ariaLabel="Revoke token"
+ >
+
+
+
+ )}
+
)}
|
diff --git a/frontend/src/pages/organization/IdentityDetailsByIDPage/components/ViewIdentityAuthModal/IdentityUniversalAuthClientSecretsTable.tsx b/frontend/src/pages/organization/IdentityDetailsByIDPage/components/ViewIdentityAuthModal/IdentityUniversalAuthClientSecretsTable.tsx
index 6f0d1aba6..1bf9be534 100644
--- a/frontend/src/pages/organization/IdentityDetailsByIDPage/components/ViewIdentityAuthModal/IdentityUniversalAuthClientSecretsTable.tsx
+++ b/frontend/src/pages/organization/IdentityDetailsByIDPage/components/ViewIdentityAuthModal/IdentityUniversalAuthClientSecretsTable.tsx
@@ -4,6 +4,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { format } from "date-fns";
import { createNotification } from "@app/components/notifications";
+import { OrgPermissionCan } from "@app/components/permissions";
import {
Button,
DeleteActionModal,
@@ -19,6 +20,7 @@ import {
Tooltip,
Tr
} from "@app/components/v2";
+import { OrgPermissionActions, OrgPermissionSubjects } from "@app/context";
import { usePopUp } from "@app/hooks";
import { useRevokeIdentityUniversalAuthClientSecret } from "@app/hooks/api";
import { ClientSecretData } from "@app/hooks/api/identities/types";
@@ -66,18 +68,23 @@ export const IdentityUniversalAuthClientSecretsTable = ({ clientSecrets, identit
Client Secrets
-
+
+ {(isAllowed) => (
+
+ )}
+
@@ -121,22 +128,30 @@ export const IdentityUniversalAuthClientSecretsTable = ({ clientSecrets, identit
{expiresAt ? format(expiresAt, "yyyy-MM-dd") : "-"}
|
-
- {
- handlePopUpOpen("revokeClientSecret", {
- clientSecretPrefix,
- clientSecretId: id
- });
- }}
- size="xs"
- colorSchema="danger"
- variant="plain"
- ariaLabel="Delete secret"
- >
-
-
-
+
+ {(isAllowed) => (
+
+ {
+ handlePopUpOpen("revokeClientSecret", {
+ clientSecretPrefix,
+ clientSecretId: id
+ });
+ }}
+ size="xs"
+ colorSchema="danger"
+ variant="plain"
+ ariaLabel="Delete secret"
+ >
+
+
+
+ )}
+
|
);
diff --git a/frontend/src/pages/organization/IdentityDetailsByIDPage/components/ViewIdentityAuthModal/ViewIdentityContentWrapper.tsx b/frontend/src/pages/organization/IdentityDetailsByIDPage/components/ViewIdentityAuthModal/ViewIdentityContentWrapper.tsx
index 558155063..03cc51181 100644
--- a/frontend/src/pages/organization/IdentityDetailsByIDPage/components/ViewIdentityAuthModal/ViewIdentityContentWrapper.tsx
+++ b/frontend/src/pages/organization/IdentityDetailsByIDPage/components/ViewIdentityAuthModal/ViewIdentityContentWrapper.tsx
@@ -2,6 +2,7 @@ import { ReactNode } from "react";
import { faChevronDown, faEdit, faTrash } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+import { OrgPermissionCan } from "@app/components/permissions";
import {
Button,
DropdownMenu,
@@ -9,6 +10,7 @@ import {
DropdownMenuItem,
DropdownMenuTrigger
} from "@app/components/v2";
+import { OrgPermissionActions, OrgPermissionSubjects } from "@app/context";
type Props = {
children: ReactNode;
@@ -34,12 +36,28 @@ export const ViewIdentityContentWrapper = ({ children, onDelete, onEdit }: Props
- }>
- Edit
-
- }>
- Delete
-
+
+ {(isAllowed) => (
+ }
+ >
+ Edit
+
+ )}
+
+
+ {(isAllowed) => (
+ }
+ >
+ Delete
+
+ )}
+