Example #1
0
        public void Seed()
        {
            var encryptor = new HashPasswordEncryptor();

            var admiRole = new Role(Guid.NewGuid(), "Administrator");
            var basicRole = new Role(Guid.NewGuid(), "Basic");
            var userEmailLogin = new UserEmailLogin("Test User", "*****@*****.**", encryptor.Encrypt("password"), "615-555-1212");
            userEmailLogin.AddRol(basicRole);
            var administratorUser = new UserEmailLogin("Admin User", "*****@*****.**", encryptor.Encrypt("password"),
                "123");
            administratorUser.AddRol(admiRole);
            administratorUser.AddRol(basicRole);

            var userAbility = new UserAbility("Developer");
            _session.Save(userAbility);
            userEmailLogin.AddAbility(userAbility);

            _session.Save(admiRole);
            _session.Save(basicRole);


            _session.Save(userEmailLogin);
            _session.Save(administratorUser);


        }
Example #2
0
 public virtual void AddAbility(UserAbility ability)
 {
     ((IList <UserAbility>)_userAbilities).Add(ability);
 }
Example #3
0
 public virtual void AddAbility(UserAbility ability)
 {
     ((IList<UserAbility>)_userAbilities).Add(ability);
 }