How do you do role based security ?



How do you do role based security ?..

Answer / 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

More Dot Net Framework Interview Questions

what is MetadData?. What is CTS? Type of Join in SQL Server? What is diffrence between Primary Key and Unique Key?

7 Answers   FutureSoft,


sql related question (outer join, left, right etc) array vs hashtable CRL sqldatareader vs dataset what is WPF, WCF, compare to WinForms Webservices Asp.net MVC vs WebForms?

0 Answers   Avanade,


What does assemblyinfo.cs file consists of ?

1 Answers   Accenture, BirlaSoft,


What are the options can be configured in AJAX helpers?

0 Answers  


What you mean by routing in mvc?

0 Answers  






What is GUID , why we use it and where

1 Answers  


What is the use of JIT

1 Answers  


what is connection pooling

5 Answers  


How to use Jquery Plugins in ASP.Net MVC validation?

0 Answers  


what are the aggregate functions in ASP.NET?

1 Answers   CTS, IBM, Zylog,


What are bundling & minification features in asp.net mvc 4?

0 Answers  


How to Create an Intranet Site Using ASP.NET MVC?

0 Answers  


Categories