Skip to content

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

fix: addressed request access inconsistency

Sheen Capadngan1d6306c29ed9
diff --git a/backend/src/ee/routes/v1/pam-routers/pam-account-router.ts b/backend/src/ee/routes/v1/pam-routers/pam-account-router.ts
index aadea7bd1d..4e11218e0f 100644
--- a/backend/src/ee/routes/v1/pam-routers/pam-account-router.ts
+++ b/backend/src/ee/routes/v1/pam-routers/pam-account-router.ts
@@ -50,12 +50,15 @@ const SanitizedAccountListItemSchema = BaseAccountFields.extend({
accountType: z.string()
});
-// The admin list surfaces accessibility so unusable accounts can be flagged in the UI
+// The admin list surfaces accessibility and approval status so the UI can show appropriate actions
const AdminAccountListItemSchema = SanitizedAccountListItemSchema.extend({
isAccessible: z.boolean().describe("Whether the account is fully provisioned to launch a session"),
accessibilityIssues: z
.array(z.nativeEnum(PamAccountAccessibilityIssue))
- .describe("Reasons the account cannot launch a session, if any")
+ .describe("Reasons the account cannot launch a session, if any"),
+ requiresApproval: z.boolean().describe("Whether this account requires approval before launching a session"),
+ accessStatus: z.nativeEnum(PamAccessStatus).describe("Current approval status for the caller"),
+ grantExpiresAt: z.date().nullable().describe("When the current grant expires, if granted")
});
const accountDetailVariants = Object.entries(ACCOUNT_TYPE_CONFIGS).map(([accountType, config]) =>
diff --git a/backend/src/ee/services/pam-account/pam-account-service.ts b/backend/src/ee/services/pam-account/pam-account-service.ts
index a5b2d74394..387217cc6f 100644
--- a/backend/src/ee/services/pam-account/pam-account-service.ts
+++ b/backend/src/ee/services/pam-account/pam-account-service.ts
@@ -200,15 +200,18 @@ export const pamAccountServiceFactory = (deps: TPamAccountServiceFactoryDep) =>
search
});
+ const accountsRequiringApproval = accounts.filter(
+ (a) => resolveAccessControls(a.templatePolicies).requiresApproval
+ );
+ const accountIdsRequiringApproval = accountsRequiringApproval.map((a) => a.id);
const folderIdsRequiringApproval = [
- ...new Set(
- accounts
- .filter((a) => resolveAccessControls(a.templatePolicies).requiresApproval && a.folderId)
- .map((a) => a.folderId!)
- )
+ ...new Set(accountsRequiringApproval.map((a) => a.folderId).filter(Boolean) as string[])
];
- const foldersWithApprovalPolicy =
- await deps.pamAccessRequestService.getFolderPolicyConfigured(folderIdsRequiringApproval);
+
+ const [accessStatusMap, foldersWithApprovalPolicy] = await Promise.all([
+ deps.pamAccessRequestService.getAccessStatusBatch(ctx.actorId, accountIdsRequiringApproval, projectId),
+ deps.pamAccessRequestService.getFolderPolicyConfigured(folderIdsRequiringApproval)
+ ]);
return accounts.map((a) => {
const { accessibilityIssues, isAccessible } = computeAccessibility(a);
@@ -216,6 +219,7 @@ export const pamAccountServiceFactory = (deps: TPamAccountServiceFactoryDep) =>
if (requiresApproval && a.folderId && !foldersWithApprovalPolicy.has(a.folderId)) {
accessibilityIssues.push(PamAccountAccessibilityIssue.NoApprovalConfig);
}
+ const statusEntry = accessStatusMap.get(a.id);
return {
id: a.id,
name: a.name,
@@ -231,6 +235,9 @@ export const pamAccountServiceFactory = (deps: TPamAccountServiceFactoryDep) =>
recordingConnectionId: a.recordingConnectionId,
isAccessible: isAccessible && accessibilityIssues.length === 0,
accessibilityIssues,
+ requiresApproval,
+ accessStatus: requiresApproval ? (statusEntry?.accessStatus ?? PamAccessStatus.None) : PamAccessStatus.None,
+ grantExpiresAt: statusEntry?.grantExpiresAt ?? null,
createdAt: a.createdAt,
updatedAt: a.updatedAt
};
diff --git a/docs/documentation/platform/pam/access-requests/overview.mdx b/docs/documentation/platform/pam/access-requests/overview.mdx
index 10e121b0fd..0e959cff0d 100644
--- a/docs/documentation/platform/pam/access-requests/overview.mdx
+++ b/docs/documentation/platform/pam/access-requests/overview.mdx
@@ -64,11 +64,11 @@ graph TD
### Filing a request
-From **My Access**, a member sees every account they can reach. Gated accounts show **Request Access** instead of **Launch**.
+From the **Accounts** page, a member sees every account they can reach. Gated accounts show a **key icon** instead of the rocket (launch) button — click the key or select **Request Access** from the menu to start a request.
-To request, the member picks the account and provides a **reason** and a **duration**, both fixed at submission. The account then shows **Pending Approval** until it clears.
+To request, the member provides a **reason** and a **duration**, both fixed at submission. The account then shows **Pending Approval** until it clears.
-Once approved, the account moves into the member's approved access with a **Launch** button and a countdown to expiry.
+Once approved, the key icon switches to the rocket icon and the member can launch sessions until the grant expires.
### Reviewing a request
diff --git a/docs/documentation/platform/pam/accounts/aws-iam.mdx b/docs/documentation/platform/pam/accounts/aws-iam.mdx
index 1560c48c56..1a93572136 100644
--- a/docs/documentation/platform/pam/accounts/aws-iam.mdx
+++ b/docs/documentation/platform/pam/accounts/aws-iam.mdx
@@ -122,8 +122,8 @@ All actions performed with the credentials are logged in [AWS CloudTrail](https:
<Tabs>
<Tab title="AWS Console">
- 1. Go to **Privileged Access Management → My Access**
- 2. Find the account and click **Launch → Connect in Browser**
+ 1. Go to **Privileged Access Management → Accounts**
+ 2. Find the account and click the rocket icon, then select **Connect in Browser**
3. You'll be taken directly to the AWS console, logged in with the role
</Tab>
<Tab title="CLI">
diff --git a/docs/documentation/platform/pam/accounts/mysql.mdx b/docs/documentation/platform/pam/accounts/mysql.mdx
index d403ac3890..dbafbdaa61 100644
--- a/docs/documentation/platform/pam/accounts/mysql.mdx
+++ b/docs/documentation/platform/pam/accounts/mysql.mdx
@@ -47,8 +47,8 @@ MySQL accounts let you manage access to your MySQL databases. Users connect thro
- **SQL Editor** — write and run SQL queries
To connect:
- 1. Go to **Privileged Access Management → My Access**
- 2. Find the account and click **Launch → Connect in Browser**
+ 1. Go to **Privileged Access Management → Accounts**
+ 2. Find the account and click the rocket icon, then select **Connect in Browser**
</Tab>
<Tab title="CLI">
diff --git a/docs/documentation/platform/pam/accounts/overview.mdx b/docs/documentation/platform/pam/accounts/overview.mdx
index d9f0f231fe..463d0974f8 100644
--- a/docs/documentation/platform/pam/accounts/overview.mdx
+++ b/docs/documentation/platform/pam/accounts/overview.mdx
@@ -53,11 +53,11 @@ Accounts live inside [folders](/documentation/platform/pam/folders/overview). To
## Connecting to an Account
-Once an account exists, users with access can connect from the **My Access** page:
+Once an account exists, users with access can connect from the **Accounts** page:
### Web Access
-Go to **Privileged Access Management → My Access**, find the account, and click **Launch → Connect in Browser**. This opens:
+Go to **Privileged Access Management → Accounts**, find the account, and click the rocket icon, then select **Connect in Browser**. This opens:
- **PostgreSQL / MySQL** — a Data Explorer for browsing tables and a SQL Editor for running queries
- **SSH** — an interactive terminal
- **AWS IAM** — opens the AWS Console with federated credentials
diff --git a/docs/documentation/platform/pam/accounts/postgresql.mdx b/docs/documentation/platform/pam/accounts/postgresql.mdx
index 9b9ee1c03e..69c09ff72e 100644
--- a/docs/documentation/platform/pam/accounts/postgresql.mdx
+++ b/docs/documentation/platform/pam/accounts/postgresql.mdx
@@ -47,8 +47,8 @@ PostgreSQL accounts let you manage access to your PostgreSQL databases. Users co
- **SQL Editor** — write and run SQL queries, use transactions
To connect:
- 1. Go to **Privileged Access Management → My Access**
- 2. Find the account and click **Launch → Connect in Browser**
+ 1. Go to **Privileged Access Management → Accounts**
+ 2. Find the account and click the rocket icon, then select **Connect in Browser**
</Tab>
<Tab title="CLI">
diff --git a/docs/documentation/platform/pam/accounts/ssh.mdx b/docs/documentation/platform/pam/accounts/ssh.mdx
index f9b9b4dbc9..a6bba69f4a 100644
--- a/docs/documentation/platform/pam/accounts/ssh.mdx
+++ b/docs/documentation/platform/pam/accounts/ssh.mdx
@@ -61,8 +61,8 @@ SSH accounts support three authentication methods: password, public key, and cer
<Tab title="Web Access">
Web Access provides an interactive terminal in your browser.
- 1. Go to **Privileged Access Management → My Access**
- 2. Find the account and click **Launch → Connect in Browser**
+ 1. Go to **Privileged Access Management → Accounts**
+ 2. Find the account and click the rocket icon, then select **Connect in Browser**
3. A terminal opens in a new tab
You get a full shell. To disconnect, type `exit` or close the tab.
diff --git a/docs/documentation/platform/pam/accounts/windows-ad.mdx b/docs/documentation/platform/pam/accounts/windows-ad.mdx
index b0841d8bf9..77daf3987d 100644
--- a/docs/documentation/platform/pam/accounts/windows-ad.mdx
+++ b/docs/documentation/platform/pam/accounts/windows-ad.mdx
@@ -47,8 +47,8 @@ Windows AD accounts require session recordings to be stored in an external S3 bu
<Tab title="Web Access">
Web Access provides a browser-based RDP client:
- 1. Go to **Privileged Access Management → My Access**
- 2. Find the account and click **Launch**
+ 1. Go to **Privileged Access Management → Accounts**
+ 2. Find the account and click the rocket icon (or select **Launch Session** from the menu)
3. If the account has multiple allowed hosts, select which host to connect to
4. Click **Connect in Browser**
5. A remote desktop session opens in a new tab
diff --git a/docs/documentation/platform/pam/accounts/windows.mdx b/docs/documentation/platform/pam/accounts/windows.mdx
index d448bd62cc..58c74e04e5 100644
--- a/docs/documentation/platform/pam/accounts/windows.mdx
+++ b/docs/documentation/platform/pam/accounts/windows.mdx
@@ -43,8 +43,8 @@ Windows accounts require session recordings to be stored in an external S3 bucke
<Tab title="Web Access">
Web Access provides a browser-based RDP client:
- 1. Go to **Privileged Access Management → My Access**
- 2. Find the account and click **Launch → Connect in Browser**
+ 1. Go to **Privileged Access Management → Accounts**
+ 2. Find the account and click the rocket icon, then select **Connect in Browser**
3. A remote desktop session opens in a new tab
You get a full Windows desktop. To disconnect, log out or close the tab.
diff --git a/docs/documentation/platform/pam/concepts/session-lifecycle.mdx b/docs/documentation/platform/pam/concepts/session-lifecycle.mdx
index 32975ce9a8..3b27507aa1 100644
--- a/docs/documentation/platform/pam/concepts/session-lifecycle.mdx
+++ b/docs/documentation/platform/pam/concepts/session-lifecycle.mdx
@@ -8,7 +8,7 @@ When you connect to an [account](/documentation/platform/pam/accounts/overview)
## Requesting Access
-When you click **Launch** on an account from the **My Access** page (or run the CLI command), PAM checks:
+When you click **Launch Session** on an account from the **Accounts** page (or run the CLI command), PAM checks:
1. **Do you have permission?** — You need a [membership](/documentation/platform/pam/concepts/access-control) (on the [folder](/documentation/platform/pam/folders/overview) or account) with the Connector or Admin role
2. **[Template](/documentation/platform/pam/templates/overview) requirements** — If the template requires a reason, you'll be prompted to enter one. If it requires MFA, you'll need to verify your identity.
diff --git a/docs/documentation/platform/pam/guides/ssh-certificate-auth.mdx b/docs/documentation/platform/pam/guides/ssh-certificate-auth.mdx
index e390d2ea87..f4b1f697df 100644
--- a/docs/documentation/platform/pam/guides/ssh-certificate-auth.mdx
+++ b/docs/documentation/platform/pam/guides/ssh-certificate-auth.mdx
@@ -43,10 +43,10 @@ This guide walks through setting up SSH certificate authentication. Instead of m
```
</Step>
<Step title="Connect">
- Your team can now connect from **My Access** — either in the browser or using the CLI proxy.
+ Your team can now connect from the **Accounts** page — either in the browser or using the CLI proxy.
- 1. Go to **Privileged Access Management → My Access**
- 2. Find the account and click **Launch**
+ 1. Go to **Privileged Access Management → Accounts**
+ 2. Find the account and click the rocket icon (or select **Launch Session** from the menu)
</Step>
</Steps>
diff --git a/docs/documentation/platform/pam/guides/team-access.mdx b/docs/documentation/platform/pam/guides/team-access.mdx
index 6e9009feef..cd7d11c524 100644
--- a/docs/documentation/platform/pam/guides/team-access.mdx
+++ b/docs/documentation/platform/pam/guides/team-access.mdx
@@ -48,10 +48,10 @@ This guide walks through giving your team secure access to a production PostgreS
</Tip>
</Step>
<Step title="Connect">
- Your team can now connect from **My Access** — either in the browser or using the CLI proxy.
+ Your team can now connect from the **Accounts** page — either in the browser or using the CLI proxy.
- 1. Go to **Privileged Access Management → My Access**
- 2. Find the account and click **Launch**
+ 1. Go to **Privileged Access Management → Accounts**
+ 2. Find the account and click the rocket icon (or select **Launch Session** from the menu)
</Step>
</Steps>
diff --git a/docs/documentation/platform/pam/quick-starts/launch-first-session.mdx b/docs/documentation/platform/pam/quick-starts/launch-first-session.mdx
index 90b4dd677d..0dee856b99 100644
--- a/docs/documentation/platform/pam/quick-starts/launch-first-session.mdx
+++ b/docs/documentation/platform/pam/quick-starts/launch-first-session.mdx
@@ -35,8 +35,8 @@ This quickstart walks you through connecting to a PostgreSQL database via PAM. Y
5. Click **Create**
</Step>
<Step title="Launch a Session">
- 1. Go to **Privileged Access Management → My Access**
- 2. Find the account you created and click **Launch**
+ 1. Go to **Privileged Access Management → Accounts**
+ 2. Find the account you created and click the rocket icon (or select **Launch Session** from the menu)
3. Click **Connect in Browser**
You'll see the Data Explorer (browse tables) and SQL Editor (run queries).
diff --git a/frontend/src/hooks/api/pam/queries.tsx b/frontend/src/hooks/api/pam/queries.tsx
index e27b32e337..65d44d7e31 100644
--- a/frontend/src/hooks/api/pam/queries.tsx
+++ b/frontend/src/hooks/api/pam/queries.tsx
@@ -242,6 +242,9 @@ type TAdminAccountListItem = {
recordingConnectionId: string | null;
isAccessible: boolean;
accessibilityIssues: PamAccountAccessibilityIssue[];
+ requiresApproval: boolean;
+ accessStatus: PamAccessStatus;
+ grantExpiresAt: string | null;
createdAt: string;
updatedAt: string;
};
diff --git a/frontend/src/pages/pam/PamAccountsPage/PamAccountsPage.tsx b/frontend/src/pages/pam/PamAccountsPage/PamAccountsPage.tsx
index fdb4d5708a..f7abaa1b08 100644
--- a/frontend/src/pages/pam/PamAccountsPage/PamAccountsPage.tsx
+++ b/frontend/src/pages/pam/PamAccountsPage/PamAccountsPage.tsx
@@ -405,6 +405,7 @@ export const PamAccountsPage = () => {
filterActive={filterActive}
onOpenAccount={(id, tab) => accountSheet.openSheet(id, tab)}
onLaunchAccount={setLaunchAccount}
+ onRequestAccess={setRequestAccount}
onDeleteAccount={(accountId, accountName, accountType) =>
handlePopUpOpen("deleteAccount", { accountId, accountName, accountType })
}
@@ -521,16 +522,13 @@ export const PamAccountsPage = () => {
}}
/>
- {/* User-only components */}
- {!isAdmin && (
- <RequestAccessSheet
- account={requestAccount}
- isOpen={!!requestAccount}
- onOpenChange={(open) => {
- if (!open) setRequestAccount(null);
- }}
- />
- )}
+ <RequestAccessSheet
+ account={requestAccount}
+ isOpen={!!requestAccount}
+ onOpenChange={(open) => {
+ if (!open) setRequestAccount(null);
+ }}
+ />
</div>
);
};
diff --git a/frontend/src/pages/pam/PamAccountsPage/components/AccountActionsMenu.tsx b/frontend/src/pages/pam/PamAccountsPage/components/AccountActionsMenu.tsx
index 4073d446b7..0c173197a9 100644
--- a/frontend/src/pages/pam/PamAccountsPage/components/AccountActionsMenu.tsx
+++ b/frontend/src/pages/pam/PamAccountsPage/components/AccountActionsMenu.tsx
@@ -1,4 +1,4 @@
-import { MoreHorizontal, Rocket, Trash2 } from "lucide-react";
+import { KeyRound, MoreHorizontal, Rocket, Trash2 } from "lucide-react";
import {
DropdownMenu,
@@ -13,6 +13,7 @@ import {
} from "@app/components/v3";
import {
isRotatablePamAccountType,
+ PamAccessStatus,
PamAccountType,
PamResourcePermissionActions,
usePamAccountActions
@@ -25,7 +26,10 @@ type Props = {
accountId: string;
accountType: PamAccountType;
isAccessible: boolean;
+ requiresApproval: boolean;
+ accessStatus: PamAccessStatus;
onLaunch: () => void;
+ onRequestAccess: () => void;
onOpenTab: (tab: PamSheetTab) => void;
onDelete: () => void;
};
@@ -34,7 +38,10 @@ export const AccountActionsMenu = ({
accountId,
accountType,
isAccessible,
+ requiresApproval,
+ accessStatus,
onLaunch,
+ onRequestAccess,
onOpenTab,
onDelete
}: Props) => {
@@ -44,11 +51,21 @@ export const AccountActionsMenu = ({
const canDelete = can(PamResourcePermissionActions.DeleteAccounts);
const isRotatable = isRotatablePamAccountType(accountType);
- // Launch requires both: account is provisioned AND user has permission
- const isLaunchDisabled = !isAccessible || !canLaunch;
- const launchDisabledReason = !canLaunch
- ? "You don't have permission to launch sessions"
- : "This account is not ready to launch";
+ const isGranted = accessStatus === PamAccessStatus.Granted;
+ const isPending = accessStatus === PamAccessStatus.Pending;
+ const needsApproval = requiresApproval && !isGranted && canLaunch;
+
+ // Launch requires: account is provisioned AND user has permission AND (no approval needed OR already granted)
+ const canLaunchNow = isAccessible && canLaunch && (!requiresApproval || isGranted);
+
+ let launchDisabledReason = "";
+ if (!canLaunch) {
+ launchDisabledReason = "You don't have permission to launch sessions";
+ } else if (!isAccessible) {
+ launchDisabledReason = "This account is not ready to launch";
+ } else {
+ launchDisabledReason = "Approval required";
+ }
return (
<DropdownMenu>
@@ -67,19 +84,35 @@ export const AccountActionsMenu = ({
{isLoading && <DropdownMenuItem isDisabled>Loading&hellip;</DropdownMenuItem>}
{!isLoading && (
<>
- <Tooltip>
- <TooltipTrigger asChild>
- <div>
- <DropdownMenuItem isDisabled={isLaunchDisabled} onClick={onLaunch}>
- <Rocket className="size-4" />
- Launch Session
- </DropdownMenuItem>
- </div>
- </TooltipTrigger>
- {isLaunchDisabled && (
- <TooltipContent side="left">{launchDisabledReason}</TooltipContent>
- )}
- </Tooltip>
+ {needsApproval ? (
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <div>
+ <DropdownMenuItem isDisabled={isPending} onClick={onRequestAccess}>
+ <KeyRound className="size-4" />
+ {isPending ? "Request Pending" : "Request Access"}
+ </DropdownMenuItem>
+ </div>
+ </TooltipTrigger>
+ {isPending && (
+ <TooltipContent side="left">Your request is awaiting approval</TooltipContent>
+ )}
+ </Tooltip>
+ ) : (
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <div>
+ <DropdownMenuItem isDisabled={!canLaunchNow} onClick={onLaunch}>
+ <Rocket className="size-4" />
+ Launch Session
+ </DropdownMenuItem>
+ </div>
+ </TooltipTrigger>
+ {!canLaunchNow && (
+ <TooltipContent side="left">{launchDisabledReason}</TooltipContent>
+ )}
+ </Tooltip>
+ )}
<DropdownMenuSeparator />
{PAM_ACCOUNT_TABS.filter(
(tab) => tab.value !== PamSheetTab.Rotation || isRotatable
diff --git a/frontend/src/pages/pam/PamAccountsPage/components/AccountRowActions.tsx b/frontend/src/pages/pam/PamAccountsPage/components/AccountRowActions.tsx
index d4081c10cd..a6bcd291c3 100644
--- a/frontend/src/pages/pam/PamAccountsPage/components/AccountRowActions.tsx
+++ b/frontend/src/pages/pam/PamAccountsPage/components/AccountRowActions.tsx
@@ -1,7 +1,8 @@
-import { Rocket } from "lucide-react";
+import { KeyRound, Rocket } from "lucide-react";
import { IconButton } from "@app/components/v3";
import {
+ PamAccessStatus,
PamAccountType,
PamResourcePermissionActions,
usePamAccountActions
@@ -14,7 +15,10 @@ type Props = {
accountId: string;
accountType: PamAccountType;
isAccessible: boolean;
+ requiresApproval: boolean;
+ accessStatus: PamAccessStatus;
onLaunch: () => void;
+ onRequestAccess: () => void;
onOpenTab: (tab: PamSheetTab) => void;
onDelete: () => void;
};
@@ -23,15 +27,50 @@ export const AccountRowActions = ({
accountId,
accountType,
isAccessible,
+ requiresApproval,
+ accessStatus,
onLaunch,
+ onRequestAccess,
onOpenTab,
onDelete
}: Props) => {
const { can } = usePamAccountActions(accountId, true);
const canLaunch = can(PamResourcePermissionActions.LaunchSessions);
- // Launch requires both: account is provisioned AND user has permission
- const isLaunchDisabled = !isAccessible || !canLaunch;
+ const isGranted = accessStatus === PamAccessStatus.Granted;
+ const isPending = accessStatus === PamAccessStatus.Pending;
+ const needsApproval = requiresApproval && !isGranted && canLaunch;
+
+ // Launch requires: account is provisioned AND user has permission AND (no approval needed OR already granted)
+ const canLaunchNow = isAccessible && canLaunch && (!requiresApproval || isGranted);
+
+ if (needsApproval) {
+ return (
+ <div className="flex items-center gap-0.5">
+ <IconButton
+ variant="ghost"
+ size="xs"
+ aria-label={isPending ? "Request pending" : "Request access"}
+ className="text-muted hover:text-foreground"
+ isDisabled={isPending}
+ onClick={onRequestAccess}
+ >
+ <KeyRound className="size-4" />
+ </IconButton>
+ <AccountActionsMenu
+ accountId={accountId}
+ accountType={accountType}
+ isAccessible={isAccessible}
+ requiresApproval={requiresApproval}
+ accessStatus={accessStatus}
+ onLaunch={onLaunch}
+ onRequestAccess={onRequestAccess}
+ onOpenTab={onOpenTab}
+ onDelete={onDelete}
+ />
+ </div>
+ );
+ }
return (
<div className="flex items-center gap-0.5">
@@ -40,7 +79,7 @@ export const AccountRowActions = ({
size="xs"
aria-label="Launch session"
className="text-muted hover:text-foreground"
- isDisabled={isLaunchDisabled}
+ isDisabled={!canLaunchNow}
onClick={onLaunch}
>
<Rocket className="size-4" />
@@ -49,7 +88,10 @@ export const AccountRowActions = ({
accountId={accountId}
accountType={accountType}
isAccessible={isAccessible}
+ requiresApproval={requiresApproval}
+ accessStatus={accessStatus}
onLaunch={onLaunch}
+ onRequestAccess={onRequestAccess}
onOpenTab={onOpenTab}
onDelete={onDelete}
/>
diff --git a/frontend/src/pages/pam/PamAccountsPage/components/FolderAccountRows.tsx b/frontend/src/pages/pam/PamAccountsPage/components/FolderAccountRows.tsx
index b6b271ee77..730aa92cd2 100644
--- a/frontend/src/pages/pam/PamAccountsPage/components/FolderAccountRows.tsx
+++ b/frontend/src/pages/pam/PamAccountsPage/components/FolderAccountRows.tsx
@@ -5,6 +5,7 @@ import { HighlightText } from "@app/components/v2/HighlightText";
import { Badge, TableCell, TableRow } from "@app/components/v3";
import { Skeleton } from "@app/components/v3/generic/Skeleton";
import {
+ PamAccessStatus,
PamAccountType,
TAccessiblePamAccount,
TPamFolderWithCount,
@@ -27,6 +28,7 @@ type Props = {
filterActive: boolean;
onOpenAccount: (accountId: string, tab?: PamSheetTab) => void;
onLaunchAccount: (account: TAccessiblePamAccount) => void;
+ onRequestAccess: (account: TAccessiblePamAccount) => void;
onDeleteAccount: (accountId: string, accountName: string, accountType: PamAccountType) => void;
onOpenFolder: (tab?: PamSheetTab) => void;
onFolderAddAccount: () => void;
@@ -43,6 +45,7 @@ export const FolderAccountRows = ({
filterActive,
onOpenAccount,
onLaunchAccount,
+ onRequestAccess,
onDeleteAccount,
onOpenFolder,
onFolderAddAccount,
@@ -127,16 +130,23 @@ export const FolderAccountRows = ({
!isLoading &&
accountsToShow.map((account) => {
const accountType = account.accountType as PamAccountType;
- const launchableAccount = {
+ const { requiresApproval, accessStatus } = account;
+ const isGranted = accessStatus === PamAccessStatus.Granted;
+ const needsApproval = requiresApproval && !isGranted;
+
+ const launchableAccount: TAccessiblePamAccount = {
id: account.id,
name: account.name,
description: account.description,
folderId: account.folderId,
- folderName: account.folderName,
+ folderName: account.folderName ?? "",
templateId: account.templateId,
templateName: account.templateName,
accountType,
- canLaunch: account.isAccessible,
+ canLaunch: account.isAccessible && !needsApproval,
+ requiresApproval,
+ accessStatus,
+ grantExpiresAt: account.grantExpiresAt,
createdAt: account.createdAt,
updatedAt: account.updatedAt
};
@@ -162,7 +172,10 @@ export const FolderAccountRows = ({
accountId={account.id}
accountType={accountType}
isAccessible={account.isAccessible}
+ requiresApproval={requiresApproval}
+ accessStatus={accessStatus}
onLaunch={() => onLaunchAccount(launchableAccount)}
+ onRequestAccess={() => onRequestAccess(launchableAccount)}
onOpenTab={(tab) => onOpenAccount(account.id, tab)}
onDelete={() => onDeleteAccount(account.id, account.name, accountType)}
/>