Thanks to visit codestin.com
Credit goes to github.com

Skip to content

User Deleted When Assigned Custom Role is Removed.  #1762

@ashishkumar-webkul

Description

@ashishkumar-webkul

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions