Which Pattern can be used for Authentication and Authorization....c#
Scenario: -
1) There is trade based winApp in c#. You开发者_开发技巧 have to see whether the user is authorized for particular module(macro level authentication).
2) Further you have to check whether authorized user is having sufficient rights to access certain reports/menus / properties etc. (more granular level authorization)
Question: -
You "have to" use design pattern(s). According to you which pattern(s) is/are suitable for this scenario.
Constraints:-
you cannot avoid using pattern(s). You have to use standard / custom pattern(s) to achieve it.
You might want to use Command pattern to see if the user is entitled to perform particular, if not disable.
Looking at MS Enterprise Libraries might help, I have seen my team use it for authentication stuff (based on roles/groups)
精彩评论