I'm building a site with CakePHP, but this question is more about solving an MVC problem than it is a CakePHP problem.
I have a User Model and a Group Model. This is a HABTM relationship, so different users may belong to multiple groups. One controller on my website handles the blog. It has many methods, but all of the views share a sidebar element with things like related posts, etc. I want to add some links to the sidebar of the blog that only a user who belongs to the Admin group can see.
At first I decided to just loop in the view element through each group that the user belongs-to, and if the Admin group is found, echo the links and break the loop.
But this seems to break the MVC pattern. Is there a better way?