No but you can create one. Get the source code for MVC3 and have a look at how the Authorize attribute is implemented. Then remove user and role verification stuff and your check for a session key.
Please click 'Mark as Answer' if my reply has assisted you
gslakmal
Member
118 Points
425 Posts
Restrict access action
Mar 26, 2012 06:46 AM|LINK
Hi,
I want allow user to access my controller action if Session["MerchId"]!=null
here is my controller action
[HttpPost] public ActionResult Create(AccountCall accountcall) { if (ModelState.IsValid) { accountcall.Id = Guid.NewGuid(); db.AccountCalls.Add(accountcall); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.AccountId = new SelectList(db.Accounts, "Id", "AccountName", accountcall.AccountId); return View(accountcall); }raduenuca
All-Star
24675 Points
4250 Posts
Re: Restrict access action
Mar 26, 2012 07:20 AM|LINK
No but you can create one. Get the source code for MVC3 and have a look at how the Authorize attribute is implemented. Then remove user and role verification stuff and your check for a session key.
Radu Enuca | Blog