Many classes and methods in my ASP.NET MVC 3 application are decorated with the [Authorize] attribute, for example:
[Authorize(Roles = "assignment_edit, assignment_view")] public class AssignmentController : Controller {
or that:
[HttpPost] [Authorize(Roles = "assignment_edit")] public ActionResult Create(AssignmentViewModel assignment) {
I would like to find a way to document which classes and methods are limited to specific roles and users, and create a report grouped by role or class, indicating who is authorized to do what. This would make it easier to understand what role the user should be given if they need to perform certain actions.
I examined the use of C #'s built-in documentation and using a tag, such as comments , to save this information, then outputting it to an xml file , but it seems awkward - I will need to re-enter information that may go out of sync with the attribute and do the subsequent processing An XML document for analyzing information and presenting it in readable form.
I am curious if anyone else has a similar need and are there any tools or processes to solve this problem?
c # asp.net-mvc
Nick silberstein
source share