public void GroupsModelConstructorTest() { MxUser user = null; // TODO: Initialize to an appropriate value string groupId = string.Empty; // TODO: Initialize to an appropriate value string groupName = string.Empty; // TODO: Initialize to an appropriate value bool adding = false; // TODO: Initialize to an appropriate value GroupsModel target = new GroupsModel(user, groupId, groupName, adding); Assert.Inconclusive("TODO: Implement code to verify target"); }
public ActionResult Add() { MxUser mxUser = GetMxUser(); if (mxUser.IsInRole("GROUP_Add")) { var model = new GroupsModel(GetMxUser(), true); return View(model); } else { return RedirectToAction("NoAccess", "Account", new { returnUrl = "Admin/Groups" }); } }
public ActionResult Edit(string groupId, string groupName, string add) { bool adding = bool.Parse(add); MxUser mxUser = GetMxUser(); if (mxUser.IsInRole("GROUP_View") || mxUser.IsInRole("GROUP_Add") || mxUser.IsInRole("GROUP_Edit") || mxUser.IsInRole("GROUP_Delete")) { var model = new GroupsModel(GetMxUser(), groupId, groupName, adding); return View(model); } else { return RedirectToAction("NoAccess", "Account", new { returnUrl = "Admin/Groups" }); } }