It's all a bit more interesting. This code should not be entirely in the view, or in the controller, or in the model. The controller in one way or another should get the user object - using a model or simply from an external service - and stuff it into the view context. The controller itself does not participate in the process of creating and processing a user, but simply transfers it. In the view, the user object's method is already called - for example, isAdmin() , which allows you to determine the current status of the user, without resorting to direct comparison, will bring the logic out, and for presentation it will exist only as a true / false flag. Of course, it doesn’t scale well, so with an increase in the number of roles, you can either create separate templates (because you still can’t store many branches in one), or create an AccessManager that has a single method hasAccessTo($user, $resourceKey) (or analog), inside which is hidden all the logic of finding access rights. Usually, however, they try to simplify everything so that by the time of rendering all the data are already known, but if such validation functionality is run in the presentation code, it is not a problem.