laratrust icon indicating copy to clipboard operation
laratrust copied to clipboard

Add support for custom checker classes. Introducing LaratrustUserCheckerInterface, LaratrustRoleCheckerInterface

Open zambodaniel opened this issue 2 years ago • 2 comments

Non breaking change, when developers are using the default checkers. If someone's not, then config needs to be adjusted:

'checker' => 'default' split into two parts

  1. 'user_checker' => 'default'
  2. 'role_checker' => 'default'

To set a custom checker for a User entity you have to use a fully qualified class name eg: 'user_checker' => \App\Checkers\MyCustomUserChecker::class And the checkers have to implement LaratrustUserCheckerInterface or LaratrustRoleCheckerInterface which contains all functions from the abstract checkers.

zambodaniel avatar Dec 09 '21 12:12 zambodaniel

I'll take a look into this PR after releasing the 7.x version for Laravel 9.

BTW thank you for the PR

santigarcor avatar Feb 17 '22 17:02 santigarcor

Hi @santigarcor!

Any update on this?

zambodaniel avatar Jul 29 '22 08:07 zambodaniel

This was fixed by #616 , closing this. Thank you for your help!

santigarcor avatar Mar 22 '23 13:03 santigarcor