I wondered if it is possible to disable/override all authorization attributes.
On the development machine, Active directory organization is completely different from production environment’s. When I develop/test on development environment I have to “remove” all authorization attributes.
Different types of active directory groups (in Authorize attribute) are used in controller action methods.
[Authorize]
...
[Authorize(Roles="domain\HR")]
...
[Authorize(Roles="domain\IT")]
...
Thanks in advance..
I’d do the following:
Write custom authorization attribute which will work as default in Release and always allow action in Debug, i.e.
Replace all existing
Authorizeattributes in code with your own, i.e.Always develop in Debug mode and publish in Release mode
If you don’t wish to be bound to Debug/Release thing you can specify your own conditional compilation symbol in project configuration – for example,
DEVTESTand replaceDEBUGwithDEVTESTin step 1 code.