Note that there are some explanatory texts on larger screens.

plurals
  1. POASP.Net MVC & Memberships
    primarykey
    data
    text
    <p>I would really appreciate some feedback on what I am trying to achieve:</p> <p>The problem:</p> <ol> <li>I would like to authorize a user of my application to a single action on the controller. For e.g.: a user can perform the "save" action on my controller class if he has the required authorization.</li> <li>In the project I am working on, the creation of roles &amp; their authorization is done by the client deployment team &amp; not in my control. So, I program to a "control point" which can be assigned to role/user, while my application needs to only check that control point.</li> <li>How do I get a control point concept into ASP.Net MVC? More specifically, how do I enable/disable buttons on the View based on the user permission on the controller?</li> </ol> <p>My solution:</p> <ol> <li>Ref.: <a href="http://weblogs.asp.net/fredriknormen/archive/2008/03/12/asp-net-mvc-framework-2-interception-and-creating-a-role-action-filter.aspx" rel="nofollow noreferrer">http://weblogs.asp.net/fredriknormen/archive/2008/03/12/asp-net-mvc-framework-2-interception-and-creating-a-role-action-filter.aspx</a> - as a starting point</li> <li>Instead of creating a role filter as explained in the link above, I would have a ControlPointFilter class which would get the model &amp; do the authorization check.</li> <li>The trouble I have is in the View class &amp; I am currently passing the control point collection to which the user has access in the ViewData[] collection.</li> <li>In the View class, I am checking if the related control point is present in the ViewData collection (which I don't like - want to keep the code to a minimum in the View class)</li> <li>The other issue is - while the actual control point name is being set in the attribute to the controller class, where/how can I pass these attributes to the view &amp; yet keep the view clean?</li> </ol> <p>Hope that helps &amp; appreciate your time/effort to answer this!</p> <p>Sunny</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload