feat: corrected label for managed by and fixed picking scope correct for

identity
This commit is contained in:
=
2025-11-13 12:52:39 +05:30
parent eead066009
commit a9c4a682d1
4 changed files with 8 additions and 10 deletions
@@ -362,7 +362,7 @@ export const permissionServiceFactory = ({
actorId, actorId,
actorType: actor actorType: actor
}); });
if (!permissionData?.length) throw new ForbiddenRequestError({ name: "You are not member of this organization" }); if (!permissionData?.length) throw new ForbiddenRequestError({ name: "You are not member of this project" });
const permissionFromRoles = permissionData.flatMap((membership) => { const permissionFromRoles = permissionData.flatMap((membership) => {
const activeRoles = membership?.roles const activeRoles = membership?.roles
@@ -234,20 +234,18 @@ export const identityAccessTokenServiceFactory = ({
parentOrgId = subOrganization.parentOrgId as string; parentOrgId = subOrganization.parentOrgId as string;
} else { } else {
const organization = await orgDAL.findOne({ id: rootOrgId });
const identityOrgMembership = await membershipIdentityDAL.findOne({ const identityOrgMembership = await membershipIdentityDAL.findOne({
scope: AccessScope.Organization, scope: AccessScope.Organization,
actorIdentityId: identityAccessToken.identityId, actorIdentityId: identityAccessToken.identityId,
scopeOrgId: rootOrgId scopeOrgId: identityOrgDetails.id
}); });
if (!identityOrgMembership) { if (!identityOrgMembership) {
throw new BadRequestError({ message: "Identity does not belong to any organization" }); throw new BadRequestError({ message: "Identity does not belong to any organization" });
} }
orgId = rootOrgId; orgId = identityOrgDetails.id;
orgName = organization.name; orgName = identityOrgDetails.name;
parentOrgId = rootOrgId; parentOrgId = rootOrgId;
} }
@@ -83,7 +83,7 @@ export const IdentityTab = withProjectPermission(
() => { () => {
const { currentProject, projectId } = useProject(); const { currentProject, projectId } = useProject();
const navigate = useNavigate(); const navigate = useNavigate();
const { isSubOrganization } = useOrganization(); const { isSubOrganization, currentOrg } = useOrganization();
const { const {
offset, offset,
@@ -279,7 +279,7 @@ export const IdentityTab = withProjectPermission(
data.identityMemberships.length > 0 && data.identityMemberships.length > 0 &&
data.identityMemberships.map((identityMember) => { data.identityMemberships.map((identityMember) => {
const { const {
identity: { id, name, projectId: identityProjectId }, identity: { id, name, projectId: identityProjectId, orgId: identityOrgId },
roles roles
} = identityMember; } = identityMember;
return ( return (
@@ -412,7 +412,7 @@ export const IdentityTab = withProjectPermission(
<ProjectIcon /> <ProjectIcon />
Project Project
</> </>
) : isSubOrganization ? ( ) : isSubOrganization && currentOrg.id === identityOrgId ? (
<> <>
<SubOrgIcon /> <SubOrgIcon />
Sub-Organization Sub-Organization
@@ -143,7 +143,7 @@ export const ProjectIdentityDetailsSection = ({ identity, membership }: Props) =
<div className="mb-4"> <div className="mb-4">
<p className="text-sm font-medium text-mineshaft-300">Identity ID</p> <p className="text-sm font-medium text-mineshaft-300">Identity ID</p>
<div className="group flex align-top"> <div className="group flex align-top">
<p className="text-sm text-mineshaft-300">{identity.id}</p> <p className="text-sm break-all text-mineshaft-300">{identity.id}</p>
<div className="opacity-0 transition-opacity duration-300 group-hover:opacity-100"> <div className="opacity-0 transition-opacity duration-300 group-hover:opacity-100">
<Tooltip content={copyTextId}> <Tooltip content={copyTextId}>
<IconButton <IconButton