Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

My organization went through the approval process of supporting the .net framework 2.0 in production. Do we need to go through the same process all over again for the .net framework 3.0? Do I need to do any application compatibility testing for my .net framework 2.0 applications?

1013


What are the difference between asynchronous controller implementation between asp.net mvc 3 & asp.net mvc 4?

1111


How to update one of my table in database at 4pm every day how it is possible?

1041


What are the 3 main components of an asp.net mvc application?

1043


What is routeconfig.cs in mvc 4?

1125


Why is the .net framework 3.0 a major version number of the .net framework if it uses the .net framework 2.0 runtime and compiler?

1036


Describe the .net framework architecture.

1077


mention what is csdl, ssdl and msl sections in an edmx file?

1026


what is entity framework?

1091


What is .net framework used for?

1032


what is deferred loading(lazy loading)?

1040


What are Non Action methods in ASP.Net MVC?

1089


What is the importance of NonActionAttribute?

1069


List the new features added in .net framework 4.0.

959


What is main objective of asp.net mvc 4 or what is new in mvc4 ?

1141