I am writing an application using CakePHP 3 that has three different types of users. While these types of users are all looking at data from the same models, the data they have access to in each of these models is wildly different. They also have very different requirements for retrieving the information.
As a simple example, User Type 1 (U1) has access to addresses and metadata about certain entities, while User Type 2 (U2) only has access to their addresses.
How should I properly structure the views to be the most maintainable, and to conform to MVC best practices? U1 and U2 each have their own controller and homepage action (/U1/home, /U2/home). When they go to look at an entity, should there be a single action for the entity (/entity/view) that shows information based on user rights, multiple actions for the entity based on what it should show (/entity/address, /entity/all), or should each user type have an action for the entity and a corresponding view (/U1/entity, /U2/entity)?
Aucun commentaire:
Enregistrer un commentaire