开发者

How do I define object base authorization in ASP.NET MVC?

I am creating an application for a video gallery, wh开发者_Python百科ere I have different types of cds like audio, video, songs, movies etc. I need to give users access to only some of the cds types, for example only songs and movies.

How can i achieve this in ASP.NET MVC?


public class ViewCDsController : BaseController
{
    [Authorize(Users="A")]]
    public ActionResult MovieType
    {
        //select only the correct CDs to return to the view

        return View();
    }    
}

check this page for more information http://www.asp.net/mvc/tutorials/authenticating-users-with-forms-authentication-cs

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜