Strip restricted fields from a plain object or model instance.
Returns a new plain object with only the fields role is allowed to see. Does not mutate the original.
role
A model instance or plain record object
The current user's role
Optional
The model class (defaults to instance.constructor)
Strip restricted fields from a plain object or model instance.
Returns a new plain object with only the fields
roleis allowed to see. Does not mutate the original.