Skip to content

Commit

Permalink
DEV - only managers or admin can delete project
Browse files Browse the repository at this point in the history
  • Loading branch information
juliecoust committed Jul 1, 2024
1 parent b55a5f3 commit 4e11909
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/domain/use-cases/project/delete-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ export class DeleteProject implements DeleteProjectUseCase {
})
}

// Ensure user is admin or has privilege to delete the project
// Ensure user is admin or has manager privilege to delete the project
private async ensureUserCanDelete(current_user: UserUpdateModel, project: ProjectRequestModel): Promise<void> {
const userIsAdmin = await this.userRepository.isAdmin(current_user.user_id);
const userHasPrivilege = await this.privilegeRepository.isGranted({
const userHasPrivilege = await this.privilegeRepository.isManager({
user_id: current_user.user_id,
project_id: project.project_id
});
Expand Down

0 comments on commit 4e11909

Please sign in to comment.