Why do I see the admin panel with access denied? #245
-
Beta Was this translation helpful? Give feedback.
Replies: 0 comments 2 replies
-
Removed check in file It is better to think over this point otherwise there may be security problems in the admin area. |
Beta Was this translation helpful? Give feedback.
-
@AlexKomMsk what is the contents of If I return If you are talking about @if(backpack_user()->hasRole('admin'))
//show items only available for users with admin role
@endif Also you should add those permission checks in your controllers so that even if someone try direct access to the resource url, the controller would deny the access. Cheers |
Beta Was this translation helpful? Give feedback.
@AlexKomMsk what is the contents of
App\Http\Middleware\CheckIfAdmin::class
?If I return
false
fromcheckIfUserIsAdmin()
I don't see any sidebar.If you are talking about
roles
andpermissions
, you should add your checks directly in thesidebar
file:Also you should add those permission checks in your controllers so that even if someone try direct access to the resource url, the controller would deny the access.
You can control that access with
$this->crud->allowAccess(['list','create'])
anddenyAccess->
in your controllers.Cheers