c# - Implementing dynamic permission control library -


i need create permissions resources , determine can read, write or delete them. these permissions in database table , should configurable administrator. want check permissions in 1 centralized place (for example filter attribute) below:

    //controller action method     [httpput]     [permissioncontrolfilter]     public apiresultbase update(plandto model)     {         ...     }      // filter attribute class     public class permissioncontrolfilterattribute : actionfilterattribute     {         public override void onactionexecuting(httpactioncontext actioncontext)         {             var permissions = getuserpermissions(user.identity.name);             // check if user has permission action ,             // can read, write or delete according model type             // , rules defined model type         }     } 

i need permissions defined user --> resource , claim --> resource.

one challenge might how define permissions when comes detailed resources. example how should define permission deny user changing specific field of entity allow changing other fields.

my current requirement asp.net web api, i'd rather use solution can used in other applications too. i'm willing use claims based security if that's important factor.


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -