Skip to content

Commit 4dc8b36

Browse files
authored
[server] don't allow blocked users to create workspaces (#19990)
* [server] don't allow blocked users to create workspaces * Check if user's blocked on a better place
1 parent 08b2361 commit 4dc8b36

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

components/server/src/workspace/workspace-service.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,9 @@ export class WorkspaceService {
705705
runningInstances: Promise<WorkspaceInstance[]>,
706706
): Promise<void> {
707707
let result: MayStartWorkspaceResult = {};
708+
if (user.blocked) {
709+
throw new ApplicationError(ErrorCodes.USER_BLOCKED, `User ${user.id} is blocked`);
710+
}
708711
try {
709712
result = await this.entitlementService.mayStartWorkspace(user, organizationId, runningInstances);
710713
TraceContext.addNestedTags(ctx, { mayStartWorkspace: { result } });

0 commit comments

Comments
 (0)