Note that there are some explanatory texts on larger screens.

plurals
  1. POguidance on authorizing users for functionality points
    primarykey
    data
    text
    <p>I'm developing an application using ASP.Net MVC 4 and need to be able to authorize users at a granular level - possibly data elements on a page, specific actions a user can take for a piece of data, etc.</p> <p>I'm currently assigning a person to a role and that role is assigned a permission (view, add, edit, and delete) for an activity. The role and permission value (I'm using bitwise values of the permission) is assigned to an activity. I'm currently defining an activity as an action in my ASP.Net MVC app. So, in order to navigate to a MVC action, the user has to have at least View permission for that action, otherwise they can't access the action. What that user can do within that action depends on their other permissions (add, edit, delete).</p> <p>This is an OK approach. All of the permissions are stored in my database, so I've pretty much decoupled the permissions from the UI itself. All I do is check to see if a user has say Add permission before showing a button to load a data entry form for example. </p> <p>I'm pretty sure this approach is not going to be granular enough. For example, if I need to hide a data column from User X in such and such role, then I'm not sure how to accommodate that requirement with my approach. Right now the View permission is all or nothing.</p> <p>I'm very very reluctant to inject a bunch of if statements in my view code controlling what is displayed to the user. This is tightly coupling the UI to my security mechanism. Not to mention you can't maintain this at all.</p> <p>So, I'm stumped as to how to make a security mechanism more granular and yet maintain a nice clean separation. When I think about this, I'm leaping directly from my current approach to injecting a bunch of if statements in my code. I'm not seeing any alternatives. Any advice, links to examples, etc. for best practices is much appreciated and needed. Thanks for your time.</p>
    singulars
    1. This table or related slice is empty.
    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.
    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