Skip to content

'User->can()' get a wrong access #2406

Answered by erikn69
lannodev asked this question in Q&A
Discussion options

You must be logged in to vote

Seems like you have direct permission, do this

Auth::user()->revokePermissionTo('users:read');
dd(
  Auth::user()->permissions->pluck('name'),
  Auth::user()->getPermissionsViaRoles()->pluck('name'),
  Auth::user()->can('users:read'),
  Auth::user()->hasPermissionTo('users:read')
);

Replies: 1 comment 1 reply

Comment options

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

Answer selected by lannodev
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