Often what's displayed to a user (e.g. on a web page) will be based partly on security checks.  I usually consider user-level / ACL security to be part of the business logic of a system.  If a view explicitly checks security to conditionally display UI elements, is it violating MVC by containing business logic?
Is the use of security conditionals in a view a violation of MVC?
web development;design patterns;security;mvc
There can be two types of security conditionals, one on the model and another on the view. The view controls the display of relevant elements depending on permissions of the current user, but the model controls access to the underlying data. As long as the model has all of the right verifications/validations, then even if the view is lacking, there is still security.Usually you have to have both, since the view needs to change for different levels/roles. The controller sends the relevant data that would change the view, but the view still needs to do something with that data to hide/display content to the right user.That's why most templating frameworks have conditional elements (Handlebars example):{{#if isCurrentUserAdmin}}    ....{{/if}So that means that it's not a violation, as long as the appropriate pieces are in the correct place.