public ActionResult Details(string name, string system, ConfigSet model) { var cs = reader.GetConfigSet(name, system); if (!cs.UserHasAccessTo()) throw new UnauthorizedAccessException("Access denied to configset"); cs.Description = model.Description; cs.LayerNames = model.LayerNames; reader.UpdateConfigSet(cs); ViewBag.Id = cs.Id; return View(cs); }
public ActionResult Create(string id1, string id2, ConfigSet model) { IConfigSet parent = null; if (id1.ContainsCharacters()) { parent = reader.GetConfigSet(id1, id2); if (!parent.UserHasAccessTo()) throw new UnauthorizedAccessException("Access denied to configset"); } else { if (ConfigReaderFactory.CurrentUser.AdministratorType != AdministratorTypes.SystemAdmin) throw new UnauthorizedAccessException("Access denied to configset"); } reader.CreateConfigSet(model.Name, string.IsNullOrEmpty(model.System) ? id2 : model.System, parent); var csId = reader.GetConfigSet(model.Name, string.IsNullOrEmpty(model.System) ? id2 : model.System); return RedirectToAction("Details", "ConfigSet", new { name = csId.Name, system = csId.System }); }
public ActionResult Delete(string name, string system, ConfigSet model) { var cs = reader.GetConfigSet(name, system); if (!cs.UserHasAccessTo()) throw new UnauthorizedAccessException("Access denied to configset"); ViewBag.Id = cs.Id; reader.DeleteConfigSet(cs); return RedirectToAction("Index", "Home"); }