Inheritance: IUser, IPrincipal
Ejemplo n.º 1
0
        private void LoginAs(string name)
        {
            UnitOfWork.Start(() =>
             	{
                CurrentUser = ObjectFactory.GetInstance<IUserRepository>().GetUser(name);
                Allowed = ObjectFactory.GetInstance<IAuthorizationService>().IsAllowed(CurrentUser, "ButtonClick");
             	});

            CurrentUserLabel.Text = CurrentUser.Name;
            button3.Enabled = Allowed;
        }
Ejemplo n.º 2
0
 protected override void SharedContext()
 {
     _user = new User();
     PermissionRepository = MockRepository.GenerateMock<IPermissionRepository>();
 }
Ejemplo n.º 3
0
 protected Permission GetPermission(bool isAllowed, User user, string actionName)
 {
     return new Permission(user, new Action {Name = actionName}, isAllowed);
 }