I am relatively new to MVC, so this is likely a novice question.
I am trying to understand the best practices for how to maintain clear separation of concerns in a few scenarios that don't appear straightfoward.
There are two scenarios I am looking at right now. Imagine a very basic app that lets users view and edit online profiles for lawyers. There is an action/view to display a particular user's profile and an action/view to edit a particular user's profile. It's easy to imagine a nice and clean Model class to represent the details of a user's profile, perhaps made with the Entity Framework and mapped to the user profile SQL table.
In the view action/view for displaying a user's profile, functionally, I need to have a button or link that lets a user edit the profile. But that should only be available to some subset of users. For example, the user can edit their own profile. Also, super users can edit anyone's profile. My question is how should the View decide if the link should be there when rendering a particular profile. I assume it is wrong for the View to contain the logic to determine if the current user can edit the current profile. Should I add a IsEditable property to the UserProfile model class? That doesn't feel tragic, but it doesn't feel completely right either. Should I make a new Model class that aggregates the UserProfile with additional information about security?
Another scenario... When editing a particular profile, one of the things that is editable is the list of specialties for a particular lawyer. The list of possible specialties is not fixed. If the view wants to render them in combo box, it needs the list of all possible specialties form the database. The view shouldn't be getting them from the database directly, so do I do the aggregate Model thing again and provide the View with both the UserProfile and a list of valid specialties?
I guess the generic issue I am trying to figure out is should I be comfortable with creating lots of little Model classes that are essentially specific to individual views. Each class would include the various unrelated parts of the larger Domain Model needed for that particular view.