asp.net mvc 4 - Roles with Profie Principal like in Stackoverflow -


i have implement membership role profile.

what means: role profile? example have manager role want give him special permissions, example read special documents or add data. or have member agent role able readonly.

i using membership & roles providers.

can give suggestion how implement kind of role profile or principal on application?

here article how configure membership provider (and role provider) in mvc.

note: need membership provider in order role provider work. otherwise, have manually create principal object (i not recommend it).

then add rolemanager tag in web.config.

<rolemanager defaultprovider="defaultroleprovider">   <providers>     <add name="defaultroleprovider"          type="system.web.providers.defaultroleprovider"          connectionstringname="defaultconnection"          applicationname="/" />    </providers> </rolemanager> 

then use authorize filter restrict access. example. authorize(roles="manager")


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -