fix: assume privileges

This commit is contained in:
Piyush Gupta
2025-12-06 01:22:50 +05:30
parent 91539ce10f
commit 8b32abaf85
5 changed files with 9 additions and 11 deletions

View File

@@ -129,7 +129,7 @@ export const newOrgMembershipUserFactory = ({
recipients: emails as string[],
substitutions: {
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 {

View File

@@ -8,7 +8,7 @@ import { useRemoveAssumeProjectPrivilege } from "@app/hooks/api";
import { ActorType } from "@app/hooks/api/auditLogs/enums";
export const AssumePrivilegeModeBanner = () => {
const { isSubOrganization, currentOrg } = useOrganization();
const { currentOrg } = useOrganization();
const { currentProject } = useProject();
const exitAssumePrivilegeMode = useRemoveAssumeProjectPrivilege();
const { assumedPrivilegeDetails } = useProjectPermission();
@@ -37,7 +37,7 @@ export const AssumePrivilegeModeBanner = () => {
},
{
onSuccess: () => {
const url = `${getProjectHomePage(currentProject.type, currentProject.environments)}${isSubOrganization ? `?subOrganization=${currentOrg.slug}` : ""}`;
const url = getProjectHomePage(currentProject.type, currentProject.environments);
window.location.assign(
url.replace("$orgId", currentOrg.id).replace("$projectId", currentProject.id)
);

View File

@@ -86,7 +86,7 @@ export const GroupMembersTable = ({ groupMembership }: Props) => {
setUserTablePreference("projectGroupMembersTable", PreferenceKey.PerPage, newPerPage);
};
const { isSubOrganization, currentOrg } = useOrganization();
const { currentOrg } = useOrganization();
const { currentProject } = useProject();
const { data: groupMemberships, isPending } = useListProjectGroupUsers({
@@ -154,7 +154,7 @@ export const GroupMembersTable = ({ groupMembership }: Props) => {
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(
url.replace("$orgId", currentOrg.id).replace("$projectId", currentProject.id)
);

View File

@@ -51,7 +51,7 @@ const Page = () => {
select: (el) => el.identityId as string
});
const { currentProject, projectId } = useProject();
const { currentOrg, isSubOrganization } = useOrganization();
const { currentOrg } = useOrganization();
const { data: identityMembershipDetails, isPending: isMembershipDetailsLoading } =
useGetProjectIdentityMembershipV2(projectId, identityId);
@@ -60,8 +60,6 @@ const Page = () => {
useDeleteProjectIdentityMembership();
const isProjectIdentity = Boolean(identityMembershipDetails?.identity.projectId);
const isNonScopedIdentity =
!isProjectIdentity && currentOrg.id !== identityMembershipDetails?.identity?.orgId;
const {
data: identity,
@@ -94,7 +92,7 @@ const Page = () => {
type: "success",
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(
url.replace("$orgId", currentOrg.id).replace("$projectId", currentProject.id)
);

View File

@@ -42,7 +42,7 @@ export const Page = () => {
strict: false,
select: (el) => el.membershipId as string
});
const { currentOrg, isSubOrganization } = useOrganization();
const { currentOrg } = useOrganization();
const { currentProject, projectId } = useProject();
const { data: membershipDetails, isPending: isMembershipDetailsLoading } =
@@ -73,7 +73,7 @@ export const Page = () => {
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(
url.replace("$orgId", currentOrg.id).replace("$projectId", currentProject.id)
);