laravel icon indicating copy to clipboard operation
laravel copied to clipboard

Field-level authorization, simplest-possible example

Open fidelix opened this issue 3 years ago • 0 comments

Hello, I've noticed that in 3 issues as well as the documentation: https://laraveljsonapi.io/docs/1.0/requests/authorization.html#relationship-authorization

It's mentioned that it's possible to do field-level authorization by writing ones own authorizer. Can someone please provide a short example? I wasn't able to do it.

I just want to limit the display of a specific field to $user->can('view sensitive data') or something like that.

Thanks,

fidelix avatar Jan 07 '22 11:01 fidelix