예제 #1
0
        public void Setup()
        {
            roles     = new RoleResolverService(
                users = new UserService(userSource = new DictionaryUserSource {
                IsDefault = true
            }),
                new RoleResolver {
                Users = users
            });
            updateChecker = new UpdateUserChecker {
                Roles = roles, Users = users
            };

            users.Store(new User {
                Login = ROLE_ADMIN, Roles = new[] { ROLE_ADMIN }, IsAdmin = true
            }.Activate());
            users.Store(new User {
                Login = ROLE_GUEST, Roles = new[] { ROLE_GUEST }
            }.Activate());
            users.Store(new User {
                Login = ROLE_USER, Roles = new[] { ROLE_USER }
            }.Activate());
            users.Store(new User {
                Login = ROLE_SECURITY_ADMIN, Roles = new[] { ROLE_SECURITY_ADMIN }
            }.Activate());
            users.Store(new User {
                Login = ROLE_DOMAIN_ADMIN, Roles = new[] { ROLE_DOMAIN_ADMIN }, Domain = ROLE_DOMAIN_ADMIN
            }.Activate());
        }
예제 #2
0
 public void Setup()
 {
     clientService     = new ClientService(
         userService   = new UserService(
             userStore = new DictionaryUserSource()));
     userStore[SecurityConst.ROLE_ADMIN.ToLowerInvariant()] = new User {
         Login = SecurityConst.ROLE_ADMIN, IsAdmin = true
     }.Activate();
     userStore[SecurityConst.ROLE_SECURITY_ADMIN.ToLowerInvariant()] = new User {
         Login = SecurityConst.ROLE_SECURITY_ADMIN, Roles = new [] { SecurityConst.ROLE_SECURITY_ADMIN }
     }.Activate();
     userStore[SecurityConst.ROLE_USER.ToLowerInvariant()] = new User {
         Login = SecurityConst.ROLE_USER
     }.Activate();
     userStore["existed@groups"] = new User {
         Login = "******", IsGroup = true
     }.Activate();
     minimalValidRequest = new ClientRecord {
         Name = "ОАО Тест", IsDemo = true
     };
     doubleRequest = new ClientRecord {
         Name = "ОАО Existed", IsDemo = true
     };
     passwordManager = new PasswordManager();
     passLogon       = new PasswordLogon {
         UserService = userService
     };
     userStateChecker = new UserStateChecker {
         UserService = userService
     };
 }
예제 #3
0
 public void Setup() {
     clientService = new ClientService(
         userService = new UserService(
             userStore = new DictionaryUserSource()));
     userStore[SecurityConst.ROLE_ADMIN.ToLowerInvariant()] = new User {Login = SecurityConst.ROLE_ADMIN,IsAdmin = true}.Activate();
     userStore[SecurityConst.ROLE_SECURITY_ADMIN.ToLowerInvariant()] = new User {Login = SecurityConst.ROLE_SECURITY_ADMIN, Roles = new [] {SecurityConst.ROLE_SECURITY_ADMIN}}.Activate();
     userStore[SecurityConst.ROLE_USER.ToLowerInvariant()] = new User {Login = SecurityConst.ROLE_USER }.Activate();
     userStore["existed@groups"] = new User {Login = "******",IsGroup = true}.Activate();
     minimalValidRequest = new ClientRecord {Name = "ОАО Тест",IsDemo = true};
     doubleRequest = new ClientRecord {Name = "ОАО Existed",IsDemo = true};
     passwordManager = new PasswordManager();
     passLogon = new PasswordLogon {UserService = userService};
     userStateChecker = new UserStateChecker {UserService = userService};
 }