Skip to content
Discussion options

You must be logged in to vote

@AlexKomMsk what is the contents of App\Http\Middleware\CheckIfAdmin::class ?

If I return false from checkIfUserIsAdmin() I don't see any sidebar.

If you are talking about roles and permissions, you should add your checks directly in the sidebar file:

@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.
You can control that access with $this->crud->allowAccess(['list','create']) and denyAccess-> in your controllers.

Cheers

Replies: 0 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by jcastroa87
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants