public AccountController( UserManager <User> userManager, SignInManager <User> signInManager, ILoggerFactory loggerFactory, IUserBlProvider userBlProvider, IConfiguration cfg) : base(cfg, userBlProvider) { _userManager = userManager; _signInManager = signInManager; _logger = loggerFactory.CreateLogger <AccountController>(); }
public HomeController( SignInManager <User> signInManager, ILogger <HomeController> logger, IUserBlProvider userBlProvider, IConfiguration cfg) : base(cfg, userBlProvider) { _signInManager = signInManager; _logger = logger; _userBlProvider = userBlProvider; _cfg = cfg; IndexModel = new HomeIndexModel(); }
public static bool IsAuthorized( PermissionItem item, IUserBlProvider userBlProvider, IConfiguration cfg, HttpContext ctx) { if (item == PermissionItem.Guest) { return(true); } User user = null; user = userBlProvider.GetUser(ctx.User); if (user == null) { return(false); } switch (item) { case PermissionItem.Admin: { var isAdmin = user.UserRoles.Any(r => r.Role != null && r.Role.Name.Contains(Constants.Admin)); return(isAdmin); } case PermissionItem.Member: { var isMember = user.UserRoles.Any( r => r.Role != null && (r.Role.Name.Contains(Constants.Admin) || r.Role.Name.Contains(Constants.Member))); return(isMember); } } return(false); }
public AttachmentController(IDeliveryBlProvider deliveryBlProvider, ISettingsBlProvider settingsBlProvider, IAttachmentBlProvider attachmentBlProvider, IConfiguration cfg, IUserBlProvider userBlProvider) : base(cfg, userBlProvider) { _settingsBlProvider = settingsBlProvider; _attachmentBlProvider = attachmentBlProvider; IndexModel = new AttachmentIndexModel(); }
public SettingsController(IJobSchedulerBlProvider jobSchedulerBlProvider, UserManager <User> userManager, ISettingsBlProvider settingsBlProvider, ILoggerFactory loggerFactory, IConfiguration cfg, IUserBlProvider userBlProvider) : base(cfg, userBlProvider) { _jobSchedulerBlProvider = jobSchedulerBlProvider; _userManager = userManager; _settingsBlProvider = settingsBlProvider; _logger = loggerFactory.CreateLogger <SettingsController>(); IndexModel = new SettingsModel(); }
public InvoiceController(IJobSchedulerBlProvider jobSchedulerBlProvider, IInvoiceBlProvider invoiceBlProvider, IConfiguration cfg, IUserBlProvider userBlProvider) : base(cfg, userBlProvider) { _jobSchedulerBlProvider = jobSchedulerBlProvider; _invoiceBlProvider = invoiceBlProvider; IndexModel = new InvoiceIndexModel(); }
public CompletionController(IEmailSendGridBlProvider emailSendGridBlProvider, ICompletionBlProvider completionBlProvider, IConfiguration cfg, IUserBlProvider userBlProvider) : base(cfg, userBlProvider) { _emailSendGridBlProvider = emailSendGridBlProvider; _completionBlProvider = completionBlProvider; IndexModel = new CompletionIndexModel(); }
public BaseController(IConfiguration cfg, IUserBlProvider userBlProvider) { Cfg = cfg; UserBlProvider = userBlProvider; }
public UserStore(IUserBlProvider blProvider) { _blProvider = blProvider; }
public DeliveryController(IOrderBlProvider orderBlProvider, ISettingsBlProvider settingsBlProvider, IDeliveryBlProvider deliveryBlProvider, IConfiguration cfg, IUserBlProvider userBlProvider) : base(cfg, userBlProvider) { _orderBlProvider = orderBlProvider; _settingsBlProvider = settingsBlProvider; _deliveryBlProvider = deliveryBlProvider; IndexModel = new DeliveryIndexModel(); }
public OrderController(ISettingsBlProvider settingsBlProvider, IOrderBlProvider orderBlProvider, IConfiguration cfg, IUserBlProvider userBlProvider) : base(cfg, userBlProvider) { _settingsBlProvider = settingsBlProvider; _orderBlProvider = orderBlProvider; IndexModel = new OrderIndexModel(); }