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

Can you please explain the request flow in ASP.NET MVC framework?

1063


Explain unit test done by tester on development team?

941


How do I use partial view?

917


How do you handle variable number of segments in a route definition?

919


explain how you can load related entities in ef (entity framework)?

935


what is conceptual model?

979


explain lazy loading, eager loading, and explicit loading?

959


Can a view be shared across multiple controllers? If yes, how we can do that?

1006


What is the need of Action Filters in ASP.Net MVC

1039


What is Separation of Concerns in ASP.NET ASP.Net MVC?

1101


Does Tempdata hold the data for other request in ASP.Net MVC?

914


Explain the new features 3.5 framework against with the tool?

901


What is attribute routing in mvc?

1045


How we can register the Area in ASP.Net MVC?

1055


Where are the routing rules defined in an asp.net mvc application?

984