Ejemplo n.º 1
0
 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");
 }
Ejemplo n.º 2
0
 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" });
     }
 }
Ejemplo n.º 3
0
 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" });
     }
 }