How do you do role based security ?
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 |
What is the use of the default route {resource}.axd/{*pathinfo} ?
What is the difference between old ADO.NET and Entity framework coding techniques?
Explain how to use multiple submit buttons in ASP.Net MVC?
Can I add asp.net mvc testcases in visual studio express?
Explain unit test done by tester on development team?
What is the common property in .net?
If we write any code for DataGrid methods, what is the access specifier used for that methods in the code behind file and why?
how do you truncate a table using entity data model?
What are the 2 ways of adding constraints to a route?
Speaking of Boolean data types, what's different between C# and C/C++ ?
How big is the char ?
What is the significance of nonactionattribute?