Esempio n. 1
0
        protected override bool AuthorizeCore(HttpContextBase httpContext)
        {
            Verify.NotNull(httpContext, nameof(httpContext));

            var systemLogin = new DivingTrackerEntities().SystemLogins
                              .FirstOrDefault(x => x.EmailAddress.Equals(httpContext.User.Identity.Name));

            return(systemLogin?.Users.Any(x => _roles.Contains((SystemRoles)x.SystemRole.SystemRoleId)) ?? false);
        }
Esempio n. 2
0
        public AuthenticationController(DivingTrackerEntities databaseContext,
                                        IAuthenticationService authenticationService, IEmailService emailService)
            : base(databaseContext)
        {
            Verify.NotNull(authenticationService, nameof(authenticationService));
            Verify.NotNull(emailService, nameof(emailService));

            _authenticationService = authenticationService;
            _emailService          = emailService;
        }
Esempio n. 3
0
 public ErrorController(DivingTrackerEntities databaseContext)
     : base(databaseContext)
 {
 }
 public AuthenticationWorkflow(DivingTrackerEntities databaseContext)
 {
     _databaseContext = databaseContext;
 }
        public DivingTrackerBaseController(DivingTrackerEntities databaseContext)
        {
            Verify.NotNull(databaseContext, nameof(databaseContext));

            DatabaseContext = databaseContext;
        }
 public MembersController(DivingTrackerEntities databaseContext)
     : base(databaseContext)
 {
 }
Esempio n. 7
0
 public EmailWorkflow(DivingTrackerEntities databaseContext)
 {
     _databaseContext = databaseContext;
 }
Esempio n. 8
0
 public QualificationsController(DivingTrackerEntities databaseContext)
     : base(databaseContext)
 {
 }
 public TrainingController(DivingTrackerEntities databaseContext)
     : base(databaseContext)
 {
 }