Example #1
0
 public ActionResult CreateAuthorize(int User, ImplicitRightViewModel roles)
 {
     _roleService.InsertWithUserRelation(User, roles.RoleRightDisplay);
     ViewBag.Roles = from role in _roleService.FindAll()
                     select new RoleViewModel().FromEntity <RoleViewModel>(role);
     return(Redirect("AuthorizeUser"));
 }
Example #2
0
 public ActionResult ImportRight(ImplicitRightViewModel model)
 {
     if (model.RoleRightDisplay == null ||
         model.RoleRightDisplay.Length == 0)
     {
         ViewBag.IsUpdateSuccess = false;
     }
     else
     {
         var entity = from selected in model.RoleRightDisplay
                      let ar = selected.Split('\\')
                               select new AdminAccessRightEntity()
         {
             ControllName = ar[0]
             ,
             ActionName = ar[1]
             ,
             InUser = CurrentUser.CustomerId
         };
         _rightService.InsertIfNotPresent(entity);
         ViewBag.IsUpdateSucccess = true;
     }
     ViewBag.ImplicitRights = ReflectPublichActionsInCurrentDll();
     return(View(model));
 }
Example #3
0
 public ActionResult EditAuthorize(int User, ImplicitRightViewModel roles)
 {
     _roleService.UpdateWithUserRelation(User, roles.RoleRightDisplay);
     ViewBag.Roles = from role in _roleService.FindAll()
                     select new RoleViewModel().FromEntity <RoleViewModel>(role);
     ViewBag.IsUpdateSuccess = true;
     return(View(new UserRoleViewModel().FromEntity <UserRoleViewModel>(_customerService.Find(User))));
 }