Пример #1
0
 public ServiceRequestContext(IMapServer mapServer, IServiceRequestInterpreter interpreter, ServiceRequest request)
 {
     _mapServer   = mapServer;
     _interpreter = interpreter;
     _request     = request;
 }
Пример #2
0
        async static public Task <IServiceRequestContext> TryCreate(IMapServer mapServer, IServiceRequestInterpreter interpreter, ServiceRequest request, bool checkSecurity = true)
        {
            var context = new ServiceRequestContext(mapServer, interpreter, request);

            if (checkSecurity == true)
            {
                var mapService = mapServer?.GetMapService(request?.Service, request?.Folder);
                if (mapService == null)
                {
                    throw new MapServerException("Unknown service");
                }

                await mapService.CheckAccess(context);
            }

            return(context);
        }