Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Bugfix/MCP feature flag check in update of access (#8320)

Thomas Kaul7d3241c67992
diff --git a/apps/api/src/app/endpoints/accesses/access.controller.ts b/apps/api/src/app/endpoints/accesses/access.controller.ts
index 517e19fb02..4d3c574762 100644
--- a/apps/api/src/app/endpoints/accesses/access.controller.ts
+++ b/apps/api/src/app/endpoints/accesses/access.controller.ts
@@ -192,6 +192,16 @@ export class AccessController {
);
}
+ if (
+ originalAccess.type === 'MCP' &&
+ !this.configurationService.get('ENABLE_FEATURE_MCP')
+ ) {
+ throw new HttpException(
+ getReasonPhrase(StatusCodes.BAD_REQUEST),
+ StatusCodes.BAD_REQUEST
+ );
+ }
+
if (
!isValidGranteeOfAccess({
granteeUserId: data.granteeUserId,
diff --git a/apps/api/src/app/endpoints/accesses/accesses.controller.ts b/apps/api/src/app/endpoints/accesses/accesses.controller.ts
index 5b43dde7d0..78db7a135b 100644
--- a/apps/api/src/app/endpoints/accesses/accesses.controller.ts
+++ b/apps/api/src/app/endpoints/accesses/accesses.controller.ts
@@ -182,6 +182,16 @@ export class AccessesController {
);
}
+ if (
+ originalAccess.type === 'MCP' &&
+ !this.configurationService.get('ENABLE_FEATURE_MCP')
+ ) {
+ throw new HttpException(
+ getReasonPhrase(StatusCodes.BAD_REQUEST),
+ StatusCodes.BAD_REQUEST
+ );
+ }
+
if (
!isValidGranteeOfAccess({
granteeUserId: data.granteeUserId,