コード例 #1
0
        public ActionResult Index()
        {
            var role = Auth.GetRole();

            if (role != (int)Auth.Roles.LibraryUser && role != (int)Auth.Roles.LibraryWorker && role != (int)Auth.Roles.Publisher)
            {
                Auth.SetRole((int)Auth.Roles.NotLoggedIn);
            }
            return(View());
        }
コード例 #2
0
        public ActionResult Index()
        {
            var offers = from o in db.Offers select o;

            if (Auth.GetRole() == (int)Auth.Roles.Publisher)
            {
                int id = Auth.GetUserId();
                offers = offers.Where(o => o.PublisherId == id);
            }
            return(View(offers.ToList()));
        }