Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>To achieve this in a scalable fashion with granular control you need permission-based authorization. You can try something like <a href="http://ASPSecurityKit.net" rel="nofollow">ASP Security Kit</a>. ASP Security Kit is built from ground up to build systems like this.</p> <p>Edit: This is how it can work:</p> <ol> <li>You define a unique permission code with every action method. For example, CreateRestaurant, ReserveRestaurant</li> <li>These permission codes are stored in a master Permissions table in the database.</li> <li>You can create a seperate roles table and associate permissions appropriately. However, ASP Security Kit introduces a new concept of <a href="http://aspsecuritykit.net/blog/designing-activity-or-permission-based-instance-aware-authorization-for-aspnet-mvc-application#impliedPermissions" rel="nofollow">implied permissions</a> so you don't need role as a separate construct; you just create a higher-level permission, for example, 'RestaurantOwner', and make other permissions implied by it.</li> <li>There's a UserPermit table which associates permissions with users. For a specific type of users, E.G. restaurant owner, you will assign applicable permissions as the user is created.</li> <li>As user logs in, you load his permissions in the memory.</li> <li>You need a mechanism by which each controller's action is executed only if user possesses the unique permission code associated with that action. If user does not, you'll redirect him to a default page with message stating "unauthorized action"</li> <li>You can also look into the user permissions loaded to display or hide menu options.</li> </ol> <p>ASP Security Kit does most of the above for you; for example, it can <a href="http://aspsecuritykit.net/Docs/GettingStarted#permissionInference" rel="nofollow">automatically infer permission code</a> for authorization so you don't have to hard code it. In addition, you need <a href="http://aspsecuritykit.net/blog/designing-activity-or-permission-based-instance-aware-authorization-for-aspnet-mvc-application#instanceOrResourceAwareAuthorization" rel="nofollow">resource checks</a> so that different users and restaurant owners do not fiddle with each other data.</p> <p>Disclosure: I'm the creator of ASP Security Kit.</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.
    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