Ejemplo n.º 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);


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