Exemplo n.º 1
0
        public void CreateAdministratorAccount()
        {
            // TODO: figure out how we an create the UoW w/o doing this
            this.Uow = new ObsequyUow(new RepositoryProvider(new RepositoryFactories()));

            // ?? we should probably put this in the web config
            var form = new AdministratorRegistrationForm()
            {
                Member = new AdminMember()
                {
                    Email     = "*****@*****.**",
                    FirstName = "Big",
                    LastName  = "Daddy",
                    IsNotifiedOnConsumerRegistrations = true,
                    IsNotifiedOnProviderRegistrations = true,
                    IsNotifiedOnAcceptedResponses     = true,
                    IsNotifiedOnExceptions            = false
                },
                Password        = "******",
                ConfirmPassword = "******",
            };

            if (!WebSecurity.UserExists(form.Member.Email))
            {
                // register this account
                CreateMember(form);

                // add appropriate roles to the account
                var roles = new string[2] {
                    Definitions.Account.Roles.Elevated, Definitions.Account.Roles.Administrator
                };

                AddRolesToUser(form.Member.Email, roles);
            }
        }
Exemplo n.º 2
0
 public BaseApiController(IObsequyUow uow)
     : base()
 {
     this.Uow = uow;
     this.Uow.AccountSession = this.AccountSession;
     this.Uow.Switchboard    = this.Switchboard;
 }
Exemplo n.º 3
0
 public AccountController(IObsequyUow uow)
     : base(uow)
 {
 }
 public ResponseController(IObsequyUow uow)
     : base(uow)
 {
 }
Exemplo n.º 5
0
 public AdministratorController(IObsequyUow uow)
     : base(uow)
 {
 }
Exemplo n.º 6
0
 public ProviderController(IObsequyUow uow)
     : base(uow)
 {
 }
 public ValidationController(IObsequyUow uow)
     : base(uow)
 {
 }
 public ConsumerController(IObsequyUow uow)
     : base(uow)
 {
 }