I am a new one for ASP.NET MVC and I have a hard test. I developed a website with many roles in it I am doing and certainly the logic and the GUI that the user receives depends on the role (duh).
This application has 10 different roles that share the same functionality but some screens will vary, depending on which roles they have.
All the examples and tutorials that I have read on the Internet and the Address Book, I have read that how a role shows an example of how to apply roles with a role (admin) in which an administrator (or Even admin area) is provided for the authorized section of the site, however, have 10 roles? Do I really need code for 10 different controllers?
Help me give information about what is being developed. There will be a menu and menu items will be filtered based on the role of the views (or pages) that they can and can not get. Those who choose, they will provide a limited view (or official page) that will provide limited functionality only from that role to the inside.
I know there are many different ways to do this, I just want to know what is the recommended or "clean" way
None of you And if so, how did you organize logic for many roles? Separate all roles to separate controllers? Are there some controllers but only authorize filtering on action messages? Apply role filtering within ideas or partial ideas and leave the controllers alone?
Unfortunately there are very few resources to implement many roles, I just want to know how this is the case of separating "correct" logic.
I will put the piece of functionality in partial view. Place a controller towards the website and load partial ideas on the basis of the role and what should be known.
I will only stray from it if you have a large amount of differences, like an administrator should be possible, then I usually make an area to fulfill that methodology.
Regardless of the controller separation I will definitely use partial ideas to reduce the duplication of the same code. When you need to keep that code, then you will get the benefit.
Comments
Post a Comment