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

In Server how to check whether model has error or not in ASP.Net MVC

0 Answers   B-Ways TecnoSoft,


What are the advantages of asp.net mvc?

0 Answers  


What are the ways to deploy an assembly?

3 Answers  


What are the different types of filters, in an asp.net mvc application?

1 Answers   NA,


What was the problem in traditional component why side by side execution is supported in .net ?

1 Answers   MMTS,






I have 2+ years of fake experience,actually i could not answer for project questions..?how can i answer please suggest me..?

0 Answers   Accenture,


What is the difference between STA and MTA?

3 Answers  


how do you truncate a table using entity data model?

0 Answers   Microsoft,


What is the difference between partial and renderpartial?

0 Answers  


What is the use of web api ? Why web api needed, if you have already restful services using wcf ?

0 Answers  


What you mean by routing in mvc?

0 Answers  


What are the advantages of razor view engine?

0 Answers  


Categories