Skip to content

Commit

Permalink
fix: search and sorting issue in ecosystem member list API
Browse files Browse the repository at this point in the history
Signed-off-by: sanjay-k1910 <[email protected]>
Signed-off-by: bhavanakarwade <[email protected]>
  • Loading branch information
sanjay-k1910 authored and KulkarniShashank committed Sep 11, 2024
1 parent b5cc656 commit 077949b
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions apps/api-gateway/src/authz/guards/ecosystem-roles.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,17 @@ export class EcosystemRolesGuard implements CanActivate {
const ecosystemOrgData = await this.ecosystemService.fetchEcosystemOrg(ecosystemId, orgId);

if (!ecosystemOrgData) {
throw new ForbiddenException(ResponseMessages.organisation.error.orgDoesNotMatch);
throw new ForbiddenException('Organization does not match');
}

user.ecosystemOrgRole = ecosystemOrgData['ecosystemRole']['name'];

if (!user.ecosystemOrgRole) {
throw new ForbiddenException(ResponseMessages.ecosystem.error.ecosystemRoleNotMatch);
throw new ForbiddenException('Ecosystem role not match');
}

} else {
throw new BadRequestException(ResponseMessages.ecosystem.error.orgEcoIdRequired);
}

// Sending user friendly message if a user attempts to access an API that is inaccessible to their role
const roleAccess = requiredRoles.some((role) => user.ecosystemOrgRole === role);
if (!roleAccess) {
throw new ForbiddenException(ResponseMessages.organisation.error.roleNotMatch, { cause: new Error(), description: ResponseMessages.errorMessages.forbidden });
throw new BadRequestException('organization & ecosystem is required');
}

// Sending user friendly message if a user attempts to access an API that is inaccessible to their role
Expand Down

0 comments on commit 077949b

Please sign in to comment.