private void FillViewBag(FeedModel model)
 {
     var allRoles = RoleProvider.GetAll().Select(x => x.Name).ToList();
     var currentRoles = MvcHelper.DeserializeEnumerable<IDictionary<string, object>>(model.RoleJson).Select(x => x != null && x.ContainsKey("Role") ? x["Role"].ToString() : null).Where(x => !string.IsNullOrEmpty(x)).ToList();
     allRoles = allRoles.Except(currentRoles).ToList();
     ViewBag.AllRoles = allRoles;
 }
 private FeedModel SessionModel(FeedModel model, string id)
 {
     if (model == null && id == null) {
         var obj = Session["Model"];
         model = obj != null ? obj as FeedModel : null;
     } else if (model == null && id != null) {
         model = FeedProvider.GetById(id);
     }
     Session["Model"] = model;
     return model;
 }
 public ActionResult Refresh(FeedModel model)
 {
     model = SessionModel(model, null);
     FillViewBag(model);
     return PartialView("_RoleGrid", model);
 }
 public ActionResult Autorisatie(FeedModel model)
 {
     FeedProvider.Autorisatie(model);
     return RedirectToAction("Index");
 }