public async Task <AuthResultModel> AuthForDoctorOrPatient(HttpRequest req, int userId) { AuthGUID authGUID = await GetGUIDAsync(req); if (!authGUID.Acces || authGUID.GUID == "") { return(new AuthResultModel(false, AuthStatusCode.Unauthorized)); } IAuthorizationRepository authRepository = DIContainer.Instance.GetService <IAuthorizationRepository>(); return(authRepository.HasAcces(userId, authGUID.GUID) ? new AuthResultModel(true, AuthStatusCode.Ok) : new AuthResultModel(false, AuthStatusCode.Forbidden)); }