I have recently inherited a large .NET project, which needs role implementation to be patched in it. Different roles have different access to the site, and some elements need to be hidden accordingly in relation to the role of the current user.
Given the somewhat flexible and modular architecture, this was easy enough to implement when users try to access portions of the site they do not have access to. However, I ran into problems when authenticating the visibility of controls.
Many of the controls have been implemented through their own project-specific controls, however links are mostly implemented through HtmlAnchors, and some others fields that fall into the restricted category are also generic html elements.
Is there a way I can patch this with a generic adapter, or do I have to rummage through the vast array of controls and elements present in the project and make them inherit a common base where this can be implemented singularily? Manual labor in this case would mean a lot of work, and I am not exactly sure if it is even the right approach in the end.
Basically, is there a way to make all controls and elements of the page run a check whether or not they should be rendered visible, or not in an .NET 4.0 Web Project? And can I somehow manage to patch it so that all elements have the capacity to accept and process a new attribute which describes their 'restriction level'?