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

fix: prevent user from deleting their own roles #41

Merged
merged 7 commits into from
Sep 29, 2024

Conversation

Emnaghz
Copy link
Collaborator

@Emnaghz Emnaghz commented Sep 18, 2024

Motivation

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (Storybook)
  • I have added unit tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@Emnaghz Emnaghz linked an issue Sep 18, 2024 that may be closed by this pull request
api/src/user/controllers/role.controller.ts Outdated Show resolved Hide resolved
api/src/user/controllers/role.controller.ts Outdated Show resolved Hide resolved
@medtaher123
Copy link
Contributor

I have a suggestion: wouldn't it be better to prevent role deletion only if the role is still in use? In other words, a role can only be deleted after it has been removed from all users who are using it

api/src/user/controllers/role.controller.ts Outdated Show resolved Hide resolved
api/src/user/controllers/role.controller.ts Outdated Show resolved Hide resolved
@marrouchi marrouchi merged commit 4d1fa7b into main Sep 29, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🤔 [ISSUE] - Prevent Users from Deleting Their Own Roles
3 participants