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

User Deleted When Assigned Custom Role is Removed. #1762

Closed
ashishkumar-webkul opened this issue Dec 5, 2024 · 1 comment
Closed

User Deleted When Assigned Custom Role is Removed. #1762

ashishkumar-webkul opened this issue Dec 5, 2024 · 1 comment

Comments

@ashishkumar-webkul
Copy link
Collaborator

Title:
User Deleted When Assigned Custom Role is Removed

Description:
When a new custom role is created and assigned to a user, deleting the custom role also results in the deletion of the assigned user. This behavior is unexpected and may lead to data loss. The user should remain intact even if the assigned role must get a warning message.

Steps to Reproduce:

  1. Navigate to Admin > Settings > Roles and create a new custom role.
  2. Assign the custom role to a newly created user.
  3. Delete the custom role from the system.
  4. Observe that the user assigned to the role is also deleted.

Expected Behavior:
Deleting a custom role should not delete the associated user. The user should retain access with default or alternative permissions. Also in addition we can put a warning message which can stop preventing deletion of custom role.
Example -> Role already assigned to User.

Actual Behavior:
The assigned user is deleted along with the custom role.

Acceptance Criteria:

  1. Users should not be deleted when a custom role is removed.
  2. Display a warning or prompt if the role has active user associations.
  3. Assign a default role or revoke access gracefully if necessary.

Additional Context:

Warning.should.appear.mp4
shivendra-webkul added a commit to shivendra-webkul/laravel-crm that referenced this issue Dec 9, 2024
@ashishkumar-webkul
Copy link
Collaborator Author

Checked and Found that the issue has been fixed and now warning message has been added. Please check the video for reference.

Video

Warning.message.added.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants