Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[_] feat: workspace role guard #291

Merged

Conversation

apsantiso
Copy link
Collaborator

No description provided.

@apsantiso apsantiso marked this pull request as ready for review March 15, 2024 14:57
@apsantiso apsantiso requested a review from sg-gs March 15, 2024 14:58
@apsantiso apsantiso changed the title feat: kickoff middleware workspaces feat: workspace role guard Mar 15, 2024
@apsantiso apsantiso force-pushed the feat/workspaces-permissions-middleware branch from a655d5b to 1093314 Compare March 15, 2024 15:00
@apsantiso apsantiso force-pushed the feat/workspaces-permissions-middleware branch from 1093314 to 131525b Compare March 15, 2024 15:10
src/modules/workspaces/domains/workspace-team.domain.ts Outdated Show resolved Hide resolved
src/modules/workspaces/domains/workspaces.domain.ts Outdated Show resolved Hide resolved
src/modules/workspaces/workspaces.usecase.ts Outdated Show resolved Hide resolved
src/modules/workspaces/workspaces.usecase.ts Outdated Show resolved Hide resolved
src/modules/workspaces/workspaces.usecase.ts Outdated Show resolved Hide resolved
src/modules/workspaces/workspaces.controller.ts Outdated Show resolved Hide resolved
workspaceId: string,
role: WorkspaceRole,
) {
const { workspace, workspaceUser } =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This destructuring could fail if the result from the database is null, could not?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either the workspace or the workspaceUser can be null. I handled that case in the usecase so a plain and not destructurable null is never returned.

src/modules/workspaces/guards/workspaces.guard.ts Outdated Show resolved Hide resolved
src/modules/workspaces/guards/workspaces.guard.ts Outdated Show resolved Hide resolved
src/modules/workspaces/guards/workspaces.guard.ts Outdated Show resolved Hide resolved
@apsantiso apsantiso requested a review from sg-gs March 19, 2024 06:40
src/modules/workspaces/guards/workspaces.guard.spec.ts Outdated Show resolved Hide resolved
src/modules/workspaces/guards/workspaces.guard.spec.ts Outdated Show resolved Hide resolved
src/modules/workspaces/guards/workspaces.guard.ts Outdated Show resolved Hide resolved
@apsantiso apsantiso self-assigned this Mar 19, 2024
@apsantiso apsantiso added the enhancement New feature or request label Mar 19, 2024
@apsantiso apsantiso changed the title feat: workspace role guard [_] feat: workspace role guard Mar 19, 2024
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
69.4% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@apsantiso apsantiso merged commit 5b3e593 into feat/workspaces-main Mar 19, 2024
5 of 6 checks passed
@sg-gs sg-gs deleted the feat/workspaces-permissions-middleware branch May 14, 2024 14:41
apsantiso added a commit that referenced this pull request Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ready-for-preview
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants