Ejemplo n.º 1
0
 public ActionResult Details(UserEditorViewModel userEditor)
 {
     if (userEditor != null)
     {
         if (userEditor.OldPassword != null)
         {
             if (userService.GetUserByNickname(userEditor.NickName).ToMvcUser().Password == HashForPassword.GenerateHash(userEditor.OldPassword))
             {
                 userEditor.NewPassword = HashForPassword.GenerateHash(userEditor.NewPassword);
                 if (userEditor.NewPassword == HashForPassword.GenerateHash(userEditor.ConfirmNewPassword))
                 {
                     userService.UpdateUser(userEditor.ToBllEditorUser());
                     return(View(userEditor));
                 }
             }
             else
             {
                 ModelState.AddModelError("OldPassword", "Old password is incorrect");
                 return(View(userEditor));
             }
         }
         else
         {
             userEditor.NewPassword = String.Empty;
             userService.UpdateUser(userEditor.ToBllEditorUser());
             return(View(userEditor));
         }
     }
     return(View(userEditor));
 }
Ejemplo n.º 2
0
        public ActionResult Cancel(UserEditorViewModel editorViewModel)
        {
            questStatus status = null;

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Log Operation
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = LogOperation();
            if (!questStatusDef.IsSuccess(status))
            {
                // TODO
                throw new Exception("LogOperation failed");
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Authorize
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = Authorize(editorViewModel._ctx);
            if (!questStatusDef.IsSuccess(status))
            {
                // TODO
                throw new Exception("Authorize failed");
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Direct user to list
            *---------------------------------------------------------------------------------------------------------------------------------*/
            return(RedirectToAction("Index", "Users", PropagateQueryString(Request)));
        }
Ejemplo n.º 3
0
        public questStatus Read(UserId userId, out UserEditorViewModel userEditorViewModel)
        {
            // Initialize
            questStatus status = null;

            userEditorViewModel = null;


            // Read
            Quest.Functional.ASM.User user = null;
            UsersMgr usersMgr = new UsersMgr(this.UserSession);

            status = usersMgr.Read(userId, out user);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }

            // Transfer model.
            userEditorViewModel = new UserEditorViewModel(this.UserSession);
            BufferMgr.TransferBuffer(user, userEditorViewModel);



            return(new questStatus(Severity.Success));
        }
        public ActionResult Privileges(UserEditorViewModel editorViewModel)
        {
            questStatus status = null;

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Log Operation
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = LogOperation();
            if (!questStatusDef.IsSuccess(status))
            {
                // TODO
                throw new Exception("LogOperation failed");
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Authorize
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = Authorize(editorViewModel._ctx);
            if (!questStatusDef.IsSuccess(status))
            {
                // TODO
                throw new Exception("Authorize failed");
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Return view.
            *---------------------------------------------------------------------------------------------------------------------------------*/
            // TEMPORARY
            UserEditorViewModel userEditorViewModel = new UserEditorViewModel(this.UserSession, editorViewModel);

            return(View(userEditorViewModel));
        }
        /*==================================================================================================================================
        * Public Methods
        *=================================================================================================================================*/

        #region CRUD
        //----------------------------------------------------------------------------------------------------------------------------------
        // CRUD
        //----------------------------------------------------------------------------------------------------------------------------------
        public questStatus Read(UserEditorViewModel viewModel, out UserPrivilegesViewModel userPrivilegesViewModel)
        {
            UserPrivilegesViewModel _userPrivilegesViewModel = new UserPrivilegesViewModel(this.UserSession, viewModel);

            _userPrivilegesViewModel.Id = viewModel.Id;
            return(Read(_userPrivilegesViewModel, out userPrivilegesViewModel));
        }
Ejemplo n.º 6
0
 public static UserEntity ToBllEditorUser(this UserEditorViewModel user)
 {
     return(new UserEntity
     {
         Id = user.Id,
         Name = user.Name,
         Surname = user.Surname,
         NickName = user.NickName,
         Password = user.NewPassword
     });
 }
Ejemplo n.º 7
0
 public ActionResult Details(UserEditorViewModel userViewModel, HttpPostedFileBase PictureInput)
 {
     if (PictureInput != null)
     {
         StringBuilder str = new StringBuilder();
         str.Append(ImageHelper.SaveFileToDisk(PictureInput, Server.MapPath("~/")));
         userViewModel.AvatarPath = "/UserContent/" + str;
     }
     userViewModel.NewPassword = HashForPassword.GenerateHash(userViewModel.NewPassword);
     _userService.UpdateUser(userViewModel.ToBllUserEntity());
     return(View(userViewModel));
 }
Ejemplo n.º 8
0
 public static UserEntity ToBllUserEntity(this UserEditorViewModel editorViewModel)
 {
     return new UserEntity()
     {
         Id = editorViewModel.Id,
         Name = editorViewModel.Name,
         Surname = editorViewModel.Surname,
         NickName = editorViewModel.NickName,
         Password = editorViewModel.NewPassword?? editorViewModel.Password,
         AvatarPath = editorViewModel.AvatarPath
     };
 }
 public ActionResult Details(UserEditorViewModel userViewModel, HttpPostedFileBase PictureInput)
 {
     if (PictureInput != null)
     {
         StringBuilder str = new StringBuilder();
         str.Append(ImageHelper.SaveFileToDisk(PictureInput, Server.MapPath("~/")));
         userViewModel.AvatarPath = "/UserContent/" + str;
     }
     userViewModel.NewPassword = HashForPassword.GenerateHash(userViewModel.NewPassword);
     _userService.UpdateUser(userViewModel.ToBllUserEntity());
     return View(userViewModel);
 }
Ejemplo n.º 10
0
        public ActionResult Details()
        {
            var userEntity = userService.GetUserByNickname(User.Identity.Name).ToMvcUser();
            var userEditor = new UserEditorViewModel
            {
                Id       = userEntity.Id,
                Name     = userEntity.Name,
                Surname  = userEntity.Surname,
                NickName = userEntity.NickName
            };

            return(View(userEditor));
        }
Ejemplo n.º 11
0
        public ActionResult Read(UserEditorViewModel editorViewModel)
        {
            questStatus status = null;

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Log Operation
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = LogOperation();
            if (!questStatusDef.IsSuccess(status))
            {
                // TODO
                throw new Exception("LogOperation failed");
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Authorize
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = Authorize(editorViewModel._ctx);
            if (!questStatusDef.IsSuccess(status))
            {
                // TODO
                throw new Exception("Authorize failed");
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Perform operation.
            *---------------------------------------------------------------------------------------------------------------------------------*/
            UserId userId = new UserId(editorViewModel.Id);
            UserEditorViewModel userEditorViewModel = null;
            UserEditorModeler   userEditorModeler   = new Modelers.UserEditorModeler(this.Request, this.UserSession);

            status = userEditorModeler.Read(userId, out userEditorViewModel);
            if (!questStatusDef.IsSuccess(status))
            {
                userEditorViewModel.questStatus = status;
                return(Json(editorViewModel, JsonRequestBehavior.AllowGet));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Return result.
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = new questStatus(Severity.Success);
            userEditorViewModel.questStatus = status;
            return(Json(userEditorViewModel, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 12
0
        public ActionResult UserOptions(UserEditorViewModel editorViewModel)
        {
            questStatus status = null;


            /*----------------------------------------------------------------------------------------------------------------------------------
            * Log Operation
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = LogOperation();
            if (!questStatusDef.IsSuccess(status))
            {
                UserMessageModeler userMessageModeler = new UserMessageModeler(status);
                return(Json(userMessageModeler.UserMessage, JsonRequestBehavior.AllowGet));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Authorize
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = Authorize(editorViewModel._ctx);
            if (!questStatusDef.IsSuccess(status))
            {
                UserMessageModeler userMessageModeler = new UserMessageModeler(status);
                return(Json(userMessageModeler.UserMessage, JsonRequestBehavior.AllowGet));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Perform Operation
            *---------------------------------------------------------------------------------------------------------------------------------*/
            string userId   = editorViewModel.Id < BaseId.VALID_ID ? null : new UserId(editorViewModel.Id).ToString();
            string username = editorViewModel.Username == null ? null : editorViewModel.Username.ToString();
            List <OptionValuePair> optionValuePairList = null;
            UserEditorModeler      userEditorModeler   = new UserEditorModeler(this.Request, this.UserSession);

            status = userEditorModeler.GetUserOptions(out optionValuePairList, userId, username);
            if (!questStatusDef.IsSuccess(status))
            {
                UserMessageModeler userMessageModeler = new UserMessageModeler(status);
                return(Json(userMessageModeler.UserMessage, JsonRequestBehavior.AllowGet));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Respond
            *---------------------------------------------------------------------------------------------------------------------------------*/
            return(Json(optionValuePairList, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 13
0
        public ActionResult Save(UserEditorViewModel userEditorViewModel)
        {
            questStatus status = null;

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Log Operation
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = LogOperation();
            if (!questStatusDef.IsSuccess(status))
            {
                userEditorViewModel.questStatus = status;
                return(Json(userEditorViewModel, JsonRequestBehavior.AllowGet));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Authorize
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = Authorize(userEditorViewModel._ctx);
            if (!questStatusDef.IsSuccess(status))
            {
                userEditorViewModel.questStatus = status;
                return(Json(userEditorViewModel, JsonRequestBehavior.AllowGet));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Perform operation.
            *---------------------------------------------------------------------------------------------------------------------------------*/
            bool bInitialCreation = userEditorViewModel.Id < BaseId.VALID_ID ? true : false;
            UserEditorModeler userEditorModeler = new UserEditorModeler(this.Request, this.UserSession);

            status = userEditorModeler.Save(userEditorViewModel);
            if (!questStatusDef.IsSuccess(status))
            {
                userEditorViewModel.questStatus = status;
                return(Json(userEditorViewModel, JsonRequestBehavior.AllowGet));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Return result.
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = new questStatus(Severity.Success, "User successfully" + (bInitialCreation ? " created" : " updated"));
            userEditorViewModel.questStatus = status;
            return(Json(userEditorViewModel, JsonRequestBehavior.AllowGet));
        }
        public ActionResult Groups(UserEditorViewModel editorViewModel)
        {
            questStatus status = null;

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Log Operation
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = LogOperation();
            if (!questStatusDef.IsSuccess(status))
            {
                // TODO
                throw new Exception("LogOperation failed");
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Authorize
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = Authorize(editorViewModel._ctx);
            if (!questStatusDef.IsSuccess(status))
            {
                // TODO
                throw new Exception("Authorize failed");
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Perform operation
            *---------------------------------------------------------------------------------------------------------------------------------*/
            UserGroupsViewModel userGroupsViewModel = null;
            UserGroupsModeler   userGroupsModeler   = new UserGroupsModeler(this.Request, this.UserSession);

            status = userGroupsModeler.Read(editorViewModel, out userGroupsViewModel);
            if (!questStatusDef.IsSuccess(status))
            {
                // TODO
                throw new Exception("Authorize failed");
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Return view.
            *---------------------------------------------------------------------------------------------------------------------------------*/
            // TEMPORARY
            return(View(userGroupsViewModel));
        }
Ejemplo n.º 15
0
        public ActionResult Load(UserEditorViewModel viewModel)
        {
            questStatus status = null;

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Log Operation
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = LogOperation();
            if (!questStatusDef.IsSuccess(status))
            {
                viewModel.questStatus = status;
                return(Json(viewModel, JsonRequestBehavior.AllowGet));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Authorize
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = Authorize(viewModel._ctx);
            if (!questStatusDef.IsSuccess(status))
            {
                viewModel.questStatus = status;
                return(Json(viewModel, JsonRequestBehavior.AllowGet));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Get list of items.
            *---------------------------------------------------------------------------------------------------------------------------------*/
            List <BootstrapTreenodeViewModel> groupNodeListt = null;
            GroupsModeler groupsModeler = new GroupsModeler(this.Request, this.UserSession);

            status = groupsModeler.Load(out groupNodeListt);
            if (!questStatusDef.IsSuccess(status))
            {
                viewModel.questStatus = status;
                return(Json(viewModel, JsonRequestBehavior.AllowGet));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Return view
            *---------------------------------------------------------------------------------------------------------------------------------*/
            return(Json(groupNodeListt, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 16
0
        public ActionResult Index(UserEditorViewModel userEditorViewModel)
        {
            questStatus status = null;

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Log Operation
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = LogOperation();
            if (!questStatusDef.IsSuccess(status))
            {
                // TODO
                throw new Exception("LogOperation failed");
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Authorize
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = Authorize(userEditorViewModel._ctx);
            if (!questStatusDef.IsSuccess(status))
            {
                // TODO
                throw new Exception("Authorize failed");
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Return view.
            *---------------------------------------------------------------------------------------------------------------------------------*/
            UserEditorViewModel userEditorViewModel2 = new UserEditorViewModel(this.UserSession, userEditorViewModel);

            userEditorViewModel2.Id = userEditorViewModel.Id;
            if (userEditorViewModel.Id >= BaseId.VALID_ID)
            {
                userEditorViewModel2.questStatus = new questStatus(Severity.Warning);
            }
            else
            {
                userEditorViewModel2.questStatus = new questStatus(Severity.Success);
            }
            return(View(userEditorViewModel2));
        }
Ejemplo n.º 17
0
        /*==================================================================================================================================
        * Public Methods
        *=================================================================================================================================*/

        #region CRUD
        //----------------------------------------------------------------------------------------------------------------------------------
        // CRUD
        //----------------------------------------------------------------------------------------------------------------------------------
        public questStatus Save(UserEditorViewModel userEditorViewModel)
        {
            // Initialize
            questStatus status = null;


            // Transfer model
            Quest.Functional.ASM.User user = new Quest.Functional.ASM.User();
            BufferMgr.TransferBuffer(userEditorViewModel, user);


            // Determine if this is a create or update
            UsersMgr usersMgr = new UsersMgr(this.UserSession);

            if (userEditorViewModel.Id < BaseId.VALID_ID)
            {
                // Create
                UserId userId = null;
                status = usersMgr.Create(user, out userId);
                if (!questStatusDef.IsSuccess(status))
                {
                    FormatErrorMessage(status, userEditorViewModel);
                    return(status);
                }
                userEditorViewModel.Id = userId.Id;
            }
            else
            {
                // Update
                status = usersMgr.Update(user);
                if (!questStatusDef.IsSuccess(status))
                {
                    FormatErrorMessage(status, userEditorViewModel);
                    return(status);
                }
            }
            return(new questStatus(Severity.Success));
        }
        public ActionResult Index(UserEditorViewModel viewModel)
        {
            questStatus status = null;

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Log Operation
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = LogOperation();
            if (!questStatusDef.IsSuccess(status))
            {
                viewModel.questStatus = status;
                return(View("Index", viewModel));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Authorize
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = Authorize(viewModel._ctx);
            if (!questStatusDef.IsSuccess(status))
            {
                viewModel.questStatus = status;
                return(View("Index", viewModel));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Get user sessions.
            *---------------------------------------------------------------------------------------------------------------------------------*/
            // TODO:

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Return view.
            *---------------------------------------------------------------------------------------------------------------------------------*/
            SessionsListViewModel sessionsListViewModel = new SessionsListViewModel(this.UserSession, viewModel);

            return(View(sessionsListViewModel));
        }
        public questStatus Read(UserPrivilegesViewModel viewModel, out UserPrivilegesViewModel userPrivilegesViewModel)
        {
            // Initialize
            questStatus status = null;

            userPrivilegesViewModel = null;
            UserId userId = new UserId(viewModel.Id);


            // Get the user
            User     user     = null;
            UsersMgr usersMgr = new UsersMgr(this.UserSession);

            status = usersMgr.Read(userId, out user);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }


            // Get privileges
            List <SearchField> searchFieldList = new List <SearchField>();
            SearchOptions      searchOptions   = new SearchOptions();

            searchOptions.SearchFieldList = searchFieldList;
            QueryOptions queryOptions = new QueryOptions();

            queryOptions.SearchOptions = searchOptions;
            QueryResponse queryResponse = null;

            List <Privilege> privilegeList = null;
            PrivilegesMgr    privilegesMgr = new PrivilegesMgr(this.UserSession);

            status = privilegesMgr.List(queryOptions, out privilegeList, out queryResponse);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }


            // Get user privileges
            List <Privilege> userPrivilegeList = null;
            AccountMgr       accountMgr        = new AccountMgr(this.UserSession);

            status = accountMgr.GetUserPrivileges(userId, out userPrivilegeList);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }

            // Remove from privileges lists whatever privileges the user is already in.
            List <Privilege> unassignedPrivilegeList = new List <Privilege>();

            foreach (Privilege privilege in privilegeList)
            {
                Privilege userPrivilege = userPrivilegeList.Find(delegate(Privilege g) { return(g.Id == privilege.Id); });
                if (userPrivilege == null)
                {
                    unassignedPrivilegeList.Add(privilege);
                }
            }

            // Sort privilege lists
            unassignedPrivilegeList.Sort(delegate(Privilege i1, Privilege i2) { return(i1.Name.CompareTo(i2.Name)); });
            userPrivilegeList.Sort(delegate(Privilege i1, Privilege i2) { return(i1.Name.CompareTo(i2.Name)); });


            // Transfer model
            userPrivilegesViewModel = new UserPrivilegesViewModel(this.UserSession, viewModel);
            UserEditorViewModel userEditorViewModel = new UserEditorViewModel();

            BufferMgr.TransferBuffer(user, userEditorViewModel);
            userPrivilegesViewModel.User = userEditorViewModel;
            foreach (Privilege privilege in unassignedPrivilegeList)
            {
                BootstrapTreenodeViewModel privilegeNode = null;
                status = FormatBootstrapTreeviewNode(privilege, out privilegeNode);
                if (!questStatusDef.IsSuccess(status))
                {
                    return(status);
                }
                privilegeNode.icon = "fa fa-lock padding-right-20";
                userPrivilegesViewModel.Privileges.Add(privilegeNode);
            }
            foreach (Privilege privilege in userPrivilegeList)
            {
                BootstrapTreenodeViewModel userPrivilegeNode = null;
                status = FormatBootstrapTreeviewNode(privilege, out userPrivilegeNode);
                if (!questStatusDef.IsSuccess(status))
                {
                    return(status);
                }
                userPrivilegeNode.icon = "fa fa-unlock padding-right-20";
                userPrivilegesViewModel.UserPrivileges.Add(userPrivilegeNode);
            }
            return(new questStatus(Severity.Success));
        }
Ejemplo n.º 20
0
        public PartialViewResult Editor(Guid userId)
        {
            var model = new UserEditorViewModel(userId).Build();

            return(AreaPartialView("user/editor.cshtml", model));
        }
        public questStatus Read(UserGroupsViewModel viewModel, out UserGroupsViewModel userGroupsViewModel)
        {
            // Initialize
            questStatus status = null;

            userGroupsViewModel = null;
            UserId userId = new UserId(viewModel.Id);


            // Get the user
            User     user     = null;
            UsersMgr usersMgr = new UsersMgr(this.UserSession);

            status = usersMgr.Read(userId, out user);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }


            // Get groups
            List <SearchField> searchFieldList = new List <SearchField>();
            SearchOptions      searchOptions   = new SearchOptions();

            searchOptions.SearchFieldList = searchFieldList;
            QueryOptions queryOptions = new QueryOptions();

            queryOptions.SearchOptions = searchOptions;
            QueryResponse queryResponse = null;

            List <Group> groupList = null;
            GroupsMgr    groupsMgr = new GroupsMgr(this.UserSession);

            status = groupsMgr.List(queryOptions, out groupList, out queryResponse);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }


            // Get user groups
            List <Group> userGroupList = null;
            AccountMgr   accountMgr    = new AccountMgr(this.UserSession);

            status = accountMgr.GetUserGroups(userId, out userGroupList);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }

            // Remove from groups lists whatever groups the user is already in.
            List <Group> unassignedGroupList = new List <Group>();

            foreach (Group group in groupList)
            {
                Group userGroup = userGroupList.Find(delegate(Group g) { return(g.Id == group.Id); });
                if (userGroup == null)
                {
                    unassignedGroupList.Add(group);
                }
            }

            // Sort group lists
            unassignedGroupList.Sort(delegate(Group i1, Group i2) { return(i1.Name.CompareTo(i2.Name)); });
            userGroupList.Sort(delegate(Group i1, Group i2) { return(i1.Name.CompareTo(i2.Name)); });


            // Transfer model
            userGroupsViewModel = new UserGroupsViewModel(this.UserSession, viewModel);
            UserEditorViewModel userEditorViewModel = new UserEditorViewModel();

            BufferMgr.TransferBuffer(user, userEditorViewModel);
            userGroupsViewModel.User = userEditorViewModel;
            foreach (Group group in unassignedGroupList)
            {
                BootstrapTreenodeViewModel groupNode = null;
                status = FormatBootstrapTreeviewNode(group, out groupNode);
                if (!questStatusDef.IsSuccess(status))
                {
                    return(status);
                }
                userGroupsViewModel.Groups.Add(groupNode);
            }
            foreach (Group group in userGroupList)
            {
                BootstrapTreenodeViewModel userGroupNode = null;
                status = FormatBootstrapTreeviewNode(group, out userGroupNode);
                if (!questStatusDef.IsSuccess(status))
                {
                    return(status);
                }
                userGroupsViewModel.UserGroups.Add(userGroupNode);
            }
            return(new questStatus(Severity.Success));
        }