Skip to content

Super admin and another admins #1868

Answered by erikn69
neoacevedo asked this question in Q&A
Sep 20, 2021 · 3 comments · 13 replies
Discussion options

You must be logged in to vote

How can I to allow the dashboard for all roles?

It looks easy to me, only use request

Gate::before(function ($user, $ability) {
    return (request()->is('dashboard') && $user->roles->count()) || $user->hasRole('Super Admin') ? true : null;
});

Replies: 3 comments 13 replies

Comment options

You must be logged in to vote
1 reply
@neoacevedo
Comment options

Comment options

You must be logged in to vote
12 replies
@neoacevedo
Comment options

@neoacevedo
Comment options

@erikn69
Comment options

@neoacevedo
Comment options

@erikn69
Comment options

Answer selected by neoacevedo
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants