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
Why we need a separate mobile project template, while we can render our web application in mobile ?
Are there any parts of the .net framework 3.0 that only work on windows vista?
Can I add asp.net mvc testcases in visual studio express?
If I have multiple filters implemented, what is the order in which these filters get executed?
What is .net framework & its benefits?
How route table is created in ASP.NET MVC?
Briefly describe the roles of clr in .net framework?
What is stateless model?
what is use of entitydatasource control?
What are Action Filters in ASP.NET MVC and its use?
What is the .net framework and how does it work?
How we can add the css in mvc?
What are authentication filters in web api?
What is viewstart page in mvc?
What operating systems will the .net framework 3.0 be available for?