mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-04 21:26:17 +00:00
fix: assume privileges
This commit is contained in:
@@ -129,7 +129,7 @@ export const newOrgMembershipUserFactory = ({
|
|||||||
recipients: emails as string[],
|
recipients: emails as string[],
|
||||||
substitutions: {
|
substitutions: {
|
||||||
subOrganizationName: orgDetails.slug,
|
subOrganizationName: orgDetails.slug,
|
||||||
callback_url: `${appCfg.SITE_URL}/organizations/${dto.permission.orgId}/projects?subOrganization=${orgDetails.slug}`
|
callback_url: `${appCfg.SITE_URL}/organizations/${dto.permission.orgId}/projects`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
+2
-2
@@ -8,7 +8,7 @@ import { useRemoveAssumeProjectPrivilege } from "@app/hooks/api";
|
|||||||
import { ActorType } from "@app/hooks/api/auditLogs/enums";
|
import { ActorType } from "@app/hooks/api/auditLogs/enums";
|
||||||
|
|
||||||
export const AssumePrivilegeModeBanner = () => {
|
export const AssumePrivilegeModeBanner = () => {
|
||||||
const { isSubOrganization, currentOrg } = useOrganization();
|
const { currentOrg } = useOrganization();
|
||||||
const { currentProject } = useProject();
|
const { currentProject } = useProject();
|
||||||
const exitAssumePrivilegeMode = useRemoveAssumeProjectPrivilege();
|
const exitAssumePrivilegeMode = useRemoveAssumeProjectPrivilege();
|
||||||
const { assumedPrivilegeDetails } = useProjectPermission();
|
const { assumedPrivilegeDetails } = useProjectPermission();
|
||||||
@@ -37,7 +37,7 @@ export const AssumePrivilegeModeBanner = () => {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
const url = `${getProjectHomePage(currentProject.type, currentProject.environments)}${isSubOrganization ? `?subOrganization=${currentOrg.slug}` : ""}`;
|
const url = getProjectHomePage(currentProject.type, currentProject.environments);
|
||||||
window.location.assign(
|
window.location.assign(
|
||||||
url.replace("$orgId", currentOrg.id).replace("$projectId", currentProject.id)
|
url.replace("$orgId", currentOrg.id).replace("$projectId", currentProject.id)
|
||||||
);
|
);
|
||||||
|
|||||||
+2
-2
@@ -86,7 +86,7 @@ export const GroupMembersTable = ({ groupMembership }: Props) => {
|
|||||||
setUserTablePreference("projectGroupMembersTable", PreferenceKey.PerPage, newPerPage);
|
setUserTablePreference("projectGroupMembersTable", PreferenceKey.PerPage, newPerPage);
|
||||||
};
|
};
|
||||||
|
|
||||||
const { isSubOrganization, currentOrg } = useOrganization();
|
const { currentOrg } = useOrganization();
|
||||||
const { currentProject } = useProject();
|
const { currentProject } = useProject();
|
||||||
|
|
||||||
const { data: groupMemberships, isPending } = useListProjectGroupUsers({
|
const { data: groupMemberships, isPending } = useListProjectGroupUsers({
|
||||||
@@ -154,7 +154,7 @@ export const GroupMembersTable = ({ groupMembership }: Props) => {
|
|||||||
text: "User privilege assumption has started"
|
text: "User privilege assumption has started"
|
||||||
});
|
});
|
||||||
|
|
||||||
const url = `${getProjectHomePage(currentProject.type, currentProject.environments)}${isSubOrganization ? `?subOrganization=${currentOrg.slug}` : ""}`;
|
const url = getProjectHomePage(currentProject.type, currentProject.environments);
|
||||||
window.location.assign(
|
window.location.assign(
|
||||||
url.replace("$orgId", currentOrg.id).replace("$projectId", currentProject.id)
|
url.replace("$orgId", currentOrg.id).replace("$projectId", currentProject.id)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ const Page = () => {
|
|||||||
select: (el) => el.identityId as string
|
select: (el) => el.identityId as string
|
||||||
});
|
});
|
||||||
const { currentProject, projectId } = useProject();
|
const { currentProject, projectId } = useProject();
|
||||||
const { currentOrg, isSubOrganization } = useOrganization();
|
const { currentOrg } = useOrganization();
|
||||||
|
|
||||||
const { data: identityMembershipDetails, isPending: isMembershipDetailsLoading } =
|
const { data: identityMembershipDetails, isPending: isMembershipDetailsLoading } =
|
||||||
useGetProjectIdentityMembershipV2(projectId, identityId);
|
useGetProjectIdentityMembershipV2(projectId, identityId);
|
||||||
@@ -60,8 +60,6 @@ const Page = () => {
|
|||||||
useDeleteProjectIdentityMembership();
|
useDeleteProjectIdentityMembership();
|
||||||
|
|
||||||
const isProjectIdentity = Boolean(identityMembershipDetails?.identity.projectId);
|
const isProjectIdentity = Boolean(identityMembershipDetails?.identity.projectId);
|
||||||
const isNonScopedIdentity =
|
|
||||||
!isProjectIdentity && currentOrg.id !== identityMembershipDetails?.identity?.orgId;
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: identity,
|
data: identity,
|
||||||
@@ -94,7 +92,7 @@ const Page = () => {
|
|||||||
type: "success",
|
type: "success",
|
||||||
text: "Machine identity privilege assumption has started"
|
text: "Machine identity privilege assumption has started"
|
||||||
});
|
});
|
||||||
const url = `${getProjectHomePage(currentProject.type, currentProject.environments)}${isSubOrganization && isNonScopedIdentity ? `?subOrganization=${currentOrg.slug}` : ""}`;
|
const url = getProjectHomePage(currentProject.type, currentProject.environments);
|
||||||
window.location.assign(
|
window.location.assign(
|
||||||
url.replace("$orgId", currentOrg.id).replace("$projectId", currentProject.id)
|
url.replace("$orgId", currentOrg.id).replace("$projectId", currentProject.id)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ export const Page = () => {
|
|||||||
strict: false,
|
strict: false,
|
||||||
select: (el) => el.membershipId as string
|
select: (el) => el.membershipId as string
|
||||||
});
|
});
|
||||||
const { currentOrg, isSubOrganization } = useOrganization();
|
const { currentOrg } = useOrganization();
|
||||||
const { currentProject, projectId } = useProject();
|
const { currentProject, projectId } = useProject();
|
||||||
|
|
||||||
const { data: membershipDetails, isPending: isMembershipDetailsLoading } =
|
const { data: membershipDetails, isPending: isMembershipDetailsLoading } =
|
||||||
@@ -73,7 +73,7 @@ export const Page = () => {
|
|||||||
text: "User privilege assumption has started"
|
text: "User privilege assumption has started"
|
||||||
});
|
});
|
||||||
|
|
||||||
const url = `${getProjectHomePage(currentProject.type, currentProject.environments)}${isSubOrganization ? `?subOrganization=${currentOrg.slug}` : ""}`;
|
const url = getProjectHomePage(currentProject.type, currentProject.environments);
|
||||||
window.location.assign(
|
window.location.assign(
|
||||||
url.replace("$orgId", currentOrg.id).replace("$projectId", currentProject.id)
|
url.replace("$orgId", currentOrg.id).replace("$projectId", currentProject.id)
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user