Exemple #1
0
        public ActionResult Delete(UserBanDelete value)
        {
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }

            var ban = this.UserBanService.GetById(value.Id);

            if (ban == null)
            {
                return base.HttpNotFound();
            }

            var privilege = new UserBanPrivilege();

            if (!privilege.CanDelete(ban))
            {
                return NotAuthorized();
            }

            this.UserBanService.Delete(ban);

            return RedirectToRoute(UsersAdministrationRoutes.BanIndex);
        }
Exemple #2
0
        public ActionResult Delete(int id)
        {
            var ban = this.UserBanService.GetById(id);

            if (ban == null)
            {
                return base.HttpNotFound();
            }

            var privilege = new UserBanPrivilege();

            return privilege.CanDelete(ban) ? base.View(Views.Delete, new UserBanDelete(ban)) : NotAuthorized();
        }