feat: greepy review

This commit is contained in:
=
2025-10-20 22:05:02 +05:30
parent 2fa762e56d
commit eec2b30666
25 changed files with 65 additions and 66 deletions
@@ -356,7 +356,7 @@ export const membershipIdentityDALFactory = (db: TDbClient) => {
}
};
// this right nwo only support sub organization
// this right now only support sub organization
const listAvailableIdentities = async (orgId: string, rootOrgId: string) => {
try {
const usersConnectedToOrg = db
@@ -381,7 +381,7 @@ export const membershipIdentityDALFactory = (db: TDbClient) => {
return docs;
} catch (error) {
throw new DatabaseError({ error, name: "ListAvailableUsers" });
throw new DatabaseError({ error, name: "ListAvailableIdentities" });
}
};
@@ -57,7 +57,7 @@ export const newOrgMembershipIdentityFactory = ({
const identityDetails = await identityDAL.findById(dto.data.identityId);
if (identityDetails.orgId !== dto.permission.rootOrgId) {
throw new BadRequestError({ message: "Only identites from parent organization can be invited" });
throw new BadRequestError({ message: "Only identities from parent organization can be invited" });
}
const permissionRoles = await permissionService.getOrgPermissionByRoles(
@@ -143,11 +143,11 @@ export const newOrgMembershipIdentityFactory = ({
scope: OrganizationActionScope.ChildOrganization
});
ForbiddenError.from(permission).throwUnlessCan(OrgPermissionIdentityActions.Create, OrgPermissionSubjects.Identity);
ForbiddenError.from(permission).throwUnlessCan(OrgPermissionIdentityActions.Delete, OrgPermissionSubjects.Identity);
const identityDetails = await identityDAL.findById(dto.selector.identityId);
if (identityDetails.orgId !== dto.permission.rootOrgId) {
throw new BadRequestError({ message: "Only identites from parent organization can do this operation" });
throw new BadRequestError({ message: "Only identities from parent organization can do this operation" });
}
if (identityDetails.orgId === dto.permission.orgId) {