I need to allow the user to see some parts of a page according to his permissions.
I've seen some answers here like using @user_passes_test
( Django - user permissions to certain views? ) and checks on the template ( Should I use Django permissions checks in the template AND the view? ).
In the latter @e-satis' answer states that for my case I should use checks at the template.
My question is: How can I do this and what is the best way (performance and security wise) to do so?
To exemplify my need I thought about Facebook. In Facebook you allow certain users to see some parts of your profile page or all of it. That's exactly the behavior I need to implement.
I appreciate your thoughts.
Thanks.