Ejemplo n.º 1
0
        void ShowCreateNewUser()
        {
            IsAuthorised = false;
            var allParticipantsVM = new CreateNewUserViewModel(new MembershipContext())
            {
                ChangeToThisUserOnSave = GetCurrentPrincipal().Identity.Name == "Admin"
            };

            this.Workspaces.Add(allParticipantsVM);
            this.SetActiveWorkspace(allParticipantsVM);
        }
Ejemplo n.º 2
0
        void HandleCreateNewUserClose(CreateNewUserViewModel vm)
        {
            vm.MembershipContext.Dispose();
            var identity = GetCurrentPrincipal().Identity;

            if (identity == null || identity.IsAuthenticated == false || identity.Name == "Admin")
            {
                Logout();
            }
            else if (vm.ChangeToThisUserOnSave)
            {
                HandleAuthorisationClose();
            }
            else
            {
                IsAuthorised = true;
            }
        }