public UserState(ILogger <UserState> logger, IJSRuntime jsRuntime, IServiceProvider serviceProvider, AppState appState, UserIdService userIdService, AuthenticationStateProvider authenticationStateProvider, DatabaseManager databaseManager, NexusOptions options, DataService dataService) { this.Logger = logger; _jsRuntime = jsRuntime; _serviceProvider = serviceProvider; _appState = appState; _userIdService = userIdService; _authenticationStateProvider = authenticationStateProvider; _databaseManager = databaseManager; _options = options; _dataService = dataService; _codeDefinition = this.CreateCodeDefinition(CodeType.Filter); this.VisualizeBeginAtZero = true; this.SampleRateValues = new List <string>(); this.ExportParameters = new ExportParameters(); _appState.PropertyChanged += this.OnAppStatePropertyChanged; if (_appState.IsDatabaseInitialized) { this.Initialize(_databaseManager.Database); } }
public ProjectsController(DatabaseManager databaseManager, UserIdService userIdService, ILoggerFactory loggerFactory) { _userIdService = userIdService; _databaseManager = databaseManager; _logger = loggerFactory.CreateLogger("Nexus Explorer"); }
public override async Task <IActionResult> Get([FromRoute] Guid id, CancellationToken cancel = default) { if (id == default) { return(BadRequest()); } if (!User.IsInRole(nameof(Roles.Administrator)) && id != UserIdService.GetUserId(User)) { return(Forbid()); } return(await base.Get(id, cancel)); }