Authorize specific user from database
I want to prevent access my action methods from all users except one.How can i authorize a specific user from my database model?? help please....
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Afzaal Ahmad ZeeshanRank #60 · 27.6K reputationPosted Jun 5, 2015, 11:49 PM EDT
public ActionResult YourAction () { if(authorized) { ViewBag.Authorized = true; return View(); } else { ViewBag.Authorized = false; return View(); } }Shibly Sadik154 reputationPosted Jun 6, 2015, 4:14 AM EDT
Please help me explaining detail...
Afzaal Ahmad ZeeshanRank #60 · 27.6K reputationPosted Jun 6, 2015, 6:02 AM EDT
Shibly Sadik154 reputationPosted Jun 6, 2015, 6:36 AM EDT
Afzaal Ahmad ZeeshanRank #60 · 27.6K reputationPosted Jun 6, 2015, 7:09 AM EDT