Issue in Admin Panel login for a new user role

srinivas214 - 2 weeks ago

Hi Team, I have been facing an issue in admin login when a new user, user role is created and assigned control panel access permissions. Please find the below issue/scenario and help me to fix this.

  1. I have created 2 custom module addons (Products, Prizes)
  2. I have created a user role (Sub Admin) and given permissions (Control Panel Access, Products, Prizes)
  3. Created a new admin user and assigned "Sub Admin" role.
  4. Now when I login to admin, It is not redirecting to Products module page. Instead it is redirected to (http://localhost/admin) and showing 403 Forbidden access.

Note: I have identified that when i allow permission for Users -Can access users section, It can able to redirect to Products module (http://localhost/products) but i do not want to give the access permissions for the Users module for the "Sub Admin" role.

Please any one help me to fix this issue. Thanks!

ryanthompson - 2 weeks ago

Can they visit admin/products? Usually that's indicative of that first permission "Can Access Control Panel" not being checked.

srinivas214 - 2 weeks ago

Hi @ryanthompson ,

Thanks for the reply!

When we access (admin/products) link, we were able to access the page when the permission "Can Access Control Panel" is checked.

Our issue is not this case, Once we login with "Sub Admin" role access, it is redirecting to (/admin) URL showing 403 Forbidden access page. When we tried to access (admin/products) then we can access the products management in admin. Please help me if we can redirect to (admin/products) automatically when we login with "Sub Admin" role instead of (/admin) page.

ryanthompson - 2 weeks ago

Let's see.. are you getting to this line: https://github.com/anomalylabs/users-module/blob/2.4/src/Http/Controller/Admin/LoginController.php#L41

Are what is $home?