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

Custom Role Created Without Selecting Options Causes Exception on User Login #1761

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

Comments

@ashishkumar-webkul
Copy link
Collaborator

Title:

Custom Role Created Without Selecting Options Causes Exception on User Login

Description:

A new custom role can be created without selecting any options. When this role is assigned to a new user, an exception error occurs upon logging in with that user. This issue needs to be addressed to ensure proper role validation and prevent login errors.

Steps to Reproduce:

  1. Navigate to Admin > Settings > Roles and create a new custom role.
  2. Save the role without selecting any permissions or options.
  3. Assign this custom role to a new user.
  4. Log in with the newly created user credentials.
  5. Observe that an exception error occurs after login.

Expected Behavior:

Users with custom roles should only be created if at least one permission or option is selected, and they should be able to log in without encountering errors.

Actual Behavior:

The system allows saving a custom role without any options, resulting in an exception error on login.

Acceptance Criteria:

  1. Validate that at least one option is selected before saving a custom role.
  2. Ensure users with assigned roles can log in without errors.
  3. Display a user-friendly error message if no permissions are selected during role creation.

Additional Context:

https://prnt.sc/J-DEDBS9dOHO

Exceptional.error.mp4
amit-webkul added a commit to amit-webkul/laravel-crm that referenced this issue Dec 31, 2024
@ashishkumar-webkul
Copy link
Collaborator Author

Checked and found that now in custom role validation has been added and 1 option must be selected for saving the role and then assign it to the User.

Video

Custom.Role.Validation.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