Skip to content

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

feat: enhance identity permissions and update UI for access control links

Victor Hugo dos Santosa6875dfaf0e6
diff --git a/backend/src/ee/services/permission/project-permission.ts b/backend/src/ee/services/permission/project-permission.ts
index 9bbcc1f82f..e567102097 100644
--- a/backend/src/ee/services/permission/project-permission.ts
+++ b/backend/src/ee/services/permission/project-permission.ts
@@ -362,6 +362,10 @@ export const ActionAllowedConditions: ActionAllowedConditionsType = {
[ProjectPermissionMemberActions.AssignAdditionalPrivileges]: ["userEmail", "assignableSubject", "assignableAction"]
},
[ProjectPermissionSub.Identity]: {
+ [ProjectPermissionIdentityActions.Read]: ["identityId"],
+ [ProjectPermissionIdentityActions.Create]: ["identityId"],
+ [ProjectPermissionIdentityActions.Edit]: ["identityId"],
+ [ProjectPermissionIdentityActions.Delete]: ["identityId"],
[ProjectPermissionIdentityActions.GrantPrivileges]: [
"identityId",
"assignableRole",
@@ -373,7 +377,12 @@ export const ActionAllowedConditions: ActionAllowedConditionsType = {
"identityId",
"assignableSubject",
"assignableAction"
- ]
+ ],
+ [ProjectPermissionIdentityActions.AssumePrivileges]: ["identityId"],
+ [ProjectPermissionIdentityActions.RevokeAuth]: ["identityId"],
+ [ProjectPermissionIdentityActions.CreateToken]: ["identityId"],
+ [ProjectPermissionIdentityActions.GetToken]: ["identityId"],
+ [ProjectPermissionIdentityActions.DeleteToken]: ["identityId"]
},
[ProjectPermissionSub.Groups]: {
[ProjectPermissionGroupActions.GrantPrivileges]: ["groupName", "assignableRole"],
diff --git a/frontend/src/pages/organization/IdentityDetailsByIDPage/IdentityDetailsByIDPage.tsx b/frontend/src/pages/organization/IdentityDetailsByIDPage/IdentityDetailsByIDPage.tsx
index e3158ab6ba..f440dbc4e2 100644
--- a/frontend/src/pages/organization/IdentityDetailsByIDPage/IdentityDetailsByIDPage.tsx
+++ b/frontend/src/pages/organization/IdentityDetailsByIDPage/IdentityDetailsByIDPage.tsx
@@ -169,24 +169,29 @@ const Page = () => {
</UnstableAlertTitle>
<UnstableAlertDescription>
<p>
- This machine identity&apos;s authentication methods are managed by your
- organization. <br /> To make changes,{" "}
+ This machine identity&apos;s authentication methods are managed by your{" "}
+ organization
<OrgPermissionCan
I={OrgPermissionIdentityActions.Read}
an={OrgPermissionSubjects.Identity}
>
{(isAllowed) =>
isAllowed ? (
- <Link
- to="/organizations/$orgId/identities/$identityId"
- className="inline-block cursor-pointer text-foreground underline underline-offset-2"
- params={{
- identityId,
- orgId: data.identity.orgId
- }}
- >
- go to organization access control
- </Link>
+ <>
+ <span>
+ <br /> To make changes,{" "}
+ </span>
+ <Link
+ to="/organizations/$orgId/identities/$identityId"
+ className="inline-block cursor-pointer text-foreground underline underline-offset-2"
+ params={{
+ identityId,
+ orgId: data.identity.orgId
+ }}
+ >
+ go to organization access control
+ </Link>
+ </>
) : null
}
</OrgPermissionCan>
diff --git a/frontend/src/pages/project/IdentityDetailsByIDPage/IdentityDetailsByIDPage.tsx b/frontend/src/pages/project/IdentityDetailsByIDPage/IdentityDetailsByIDPage.tsx
index 417b3ef10b..f670e5a7e2 100644
--- a/frontend/src/pages/project/IdentityDetailsByIDPage/IdentityDetailsByIDPage.tsx
+++ b/frontend/src/pages/project/IdentityDetailsByIDPage/IdentityDetailsByIDPage.tsx
@@ -289,24 +289,30 @@ const Page = () => {
</UnstableAlertTitle>
<UnstableAlertDescription>
<p>
- This machine identity&apos;s authentication methods are managed by your
- {isSubOrgIdentity ? "sub-" : ""}organization. <br /> To make changes,{" "}
+ This machine identity&apos;s authentication methods are managed by your{" "}
+ {isSubOrgIdentity ? "sub-" : ""}organization
<OrgPermissionCan
I={OrgPermissionIdentityActions.Read}
an={OrgPermissionSubjects.Identity}
>
{(isAllowed) =>
isAllowed ? (
- <Link
- to="/organizations/$orgId/identities/$identityId"
- className="inline-block cursor-pointer text-foreground underline underline-offset-2"
- params={{
- identityId,
- orgId: identityMembershipDetails.identity.orgId
- }}
- >
- go to {isSubOrgIdentity ? "sub-" : ""}organization access control
- </Link>
+ <>
+ <span>
+ <br /> To make changes,{" "}
+ </span>
+ <Link
+ to="/organizations/$orgId/identities/$identityId"
+ className="inline-block cursor-pointer text-foreground underline underline-offset-2"
+ params={{
+ identityId,
+ orgId: identityMembershipDetails.identity.orgId
+ }}
+ >
+ go to {isSubOrgIdentity ? "sub-" : ""}organization access
+ control
+ </Link>
+ </>
) : null
}
</OrgPermissionCan>
diff --git a/frontend/src/pages/project/RoleDetailsBySlugPage/components/ProjectRoleModifySection.utils.tsx b/frontend/src/pages/project/RoleDetailsBySlugPage/components/ProjectRoleModifySection.utils.tsx
index 6c5105980e..719b59cbb2 100644
--- a/frontend/src/pages/project/RoleDetailsBySlugPage/components/ProjectRoleModifySection.utils.tsx
+++ b/frontend/src/pages/project/RoleDetailsBySlugPage/components/ProjectRoleModifySection.utils.tsx
@@ -461,15 +461,10 @@ export const ACTION_ALLOWED_CONDITIONS: ActionAllowedConditionsType = {
]
},
[ProjectPermissionSub.Identity]: {
- [ProjectPermissionIdentityActions.Read]: [],
- [ProjectPermissionIdentityActions.Create]: [],
- [ProjectPermissionIdentityActions.Edit]: [],
- [ProjectPermissionIdentityActions.Delete]: [],
- [ProjectPermissionIdentityActions.AssumePrivileges]: [],
- [ProjectPermissionIdentityActions.RevokeAuth]: [],
- [ProjectPermissionIdentityActions.CreateToken]: [],
- [ProjectPermissionIdentityActions.GetToken]: [],
- [ProjectPermissionIdentityActions.DeleteToken]: [],
+ [ProjectPermissionIdentityActions.Read]: ["identityId"],
+ [ProjectPermissionIdentityActions.Create]: ["identityId"],
+ [ProjectPermissionIdentityActions.Edit]: ["identityId"],
+ [ProjectPermissionIdentityActions.Delete]: ["identityId"],
[ProjectPermissionIdentityActions.GrantPrivileges]: [
"identityId",
"assignableRole",
@@ -481,7 +476,12 @@ export const ACTION_ALLOWED_CONDITIONS: ActionAllowedConditionsType = {
"identityId",
"assignableSubject",
"assignableAction"
- ]
+ ],
+ [ProjectPermissionIdentityActions.AssumePrivileges]: ["identityId"],
+ [ProjectPermissionIdentityActions.RevokeAuth]: ["identityId"],
+ [ProjectPermissionIdentityActions.CreateToken]: ["identityId"],
+ [ProjectPermissionIdentityActions.GetToken]: ["identityId"],
+ [ProjectPermissionIdentityActions.DeleteToken]: ["identityId"]
},
[ProjectPermissionSub.Groups]: {
[ProjectPermissionGroupActions.Read]: [],