Architecture driven by users, or by actions/content?
- by hugerth
I have a question about designing MVC app architecture.
Let's say our application has three main categories of views (items of type 1, items of type 2...). And we have three (or more in future) types of users - Admins, let's say Moderators and typical Users. And in the future there might be more of them. Admins have full access to app, Moderators can visit only 2/3 type of items, and Users can visit only basic type of items.
Should I divide my controllers/views/whatever like this:
Items "A", Items "B", Items "C", then make them 100% finished and at the end add access privileges?
Pros:
DRY option
Cons
Conditional expressions in views
Or another options: Items "A" / Admin, Items "A" / Moderator / Items "B" Admin ...?
Pros:
Divided parts of application for specific user (is that pros?)
Cons:
A lot of repeated code
I don't have great experience in planning such things so it would nice if you can give me some tips or links to learn something about it.