How do you do role based security ?
Answer Posted / narayansahu
1.Create a principle object which contains users identity
(login name) and array of roles
2.and pass this object to HttpContext.Current.User
3.The roles supplied to this object will be checked against
roles specified in the web.config file,if they matched then
they are allowed access to the page otherwise not.
allowed roles can be specified like this in web.config
<authorization>
<allow roles="Administrator,CanEdit"/>
<deny users="*" />
</authorization>
Is This Answer Correct ? | 17 Yes | 1 No |
Post New Answer View All Answers
What is the use of view model in asp.net mvc?
What are the main features of asp.net mvc 4 used by asp.net web api?
In razor syntax, what is the escape sequence character for @ symbol?
Explain the new features 3.5 framework against with the tool?
What is entitytype? : Entity framework
what is ssdl?
Where are the routing rules defined in an asp.net mvc application?
What is a model in programming?
Is razor a server side?
how do you mark a property as required? For example, for a project, the name is a required field.
explain how you can load related entities in ef (entity framework)?
what is more complex to implement property, methods or event? how can I define criteria to compare the difficulty of implementation between them? for example the number of methods wanted to implements property is 2 methods. how many methods I need it to implements events?
How does work clr?
What are the new features 3.5 framework against with the tool?
What are Model Binders in ASP.Net MVC?