I explicitly didn't want to do this, since you can basically override current_policy in your Controllers and provide custom user instead of current_user. Much easier and less indirection.
Your way would be like this:
call to current_policy inside your controller
call to current_user inside AccessGranted
which again calls current_user in the controller.
By overriding the method you can go down to just one step
call to current_policy which uses current_user in the same scope.
I explicitly didn't want to do this, since you can basically override
current_policy
in your Controllers and provide custom user instead ofcurrent_user
. Much easier and less indirection.Your way would be like this:
current_policy
inside your controllercurrent_user
inside AccessGrantedcurrent_user
in the controller.By overriding the method you can go down to just one step
current_policy
which uses current_user in the same scope.