public ActionResult SaveUBS(USB model)
        {
            if (!((CustomPrincipal)User).CanAddAdminFeature("UserBasedSecurity"))
            {
                return(RedirectToAction("Index", "Home"));
            }
            if (ModelState.IsValid)
            {
                var Db = new UserBasedSecurityContext();
                Db.UserBasedSecurities.RemoveRange(Db.UserBasedSecurities);
                Db.SaveChanges();

                foreach (var _model in model.security)
                {
                    Db.UserBasedSecurities.Add(_model);
                }
                Db.SaveChanges();
            }
            return(RedirectToAction("Index", "Admin"));
        }
        public ActionResult ClearUBS()
        {
            if (!((CustomPrincipal)User).CanAddAdminFeature("UserBasedSecurity"))
            {
                return(RedirectToAction("Index", "Home"));
            }
            var Db = new UserBasedSecurityContext();

            Db.UserBasedSecurities.RemoveRange(Db.UserBasedSecurities);
            Db.SaveChanges();
            return(RedirectToAction("Index", "Admin"));
        }