miso crkon

miso crkon

  • NA
  • 2
  • 2.3k

authorization in asp.net mvc 4

Jan 25 2014 8:13 PM
Hi,
i am a new in asp. net mvc so i would like to ask for help. I am creating a web site and using asp.net mvc 4 (empty ) where i am using my own login. I dont use internet or intranet template. Login is working perfectly but now i need to authorize some pages ( administration) for administrator only. I have spent hours now and i am lost. I use entity framework where i store user data id, email( what is also username) and password. This table has a field roles as i was thinking to use it such as if roles== admin go to the admin page. I would like to use  [Authorize(Roles = "Admin")] for my site but i dont know how to implement it. Is it able to use it without using any template ( like internet or intranet which may use windows authentication and authorization)? Can you recommend me some information sources? Thanks for your help, Miso