I'm just wondering how to restrict access to the properties of only the $ owner role. For example, in my case, I have a Joke that has an Author. The author has a User as a basis. I would like other Authers / Users to see who created the Joke, but they should not see Authers email only if the author owns the joke itself, it should be OK to show my email, just for the sake of this case.
Looking at the built-in User model, you can see that they use a hidden function to hide the password, but using this for their email will also hide their email for the owner $, which I did not want
Let me know if something is unclear.
Thanks in advance
source
share