Example #1
0
        public IHttpActionResult Get()
        {
            var ctx    = new ViaducContext(WebHelper.Settings["sqlConnectionString"]);
            var access = ManagementHelper.GetUserAccess();

            var items = ctx.OrderingFlatItem.AsQueryable()
                        .Where(o => o.Status != (int)OrderStatesInternal.ImBestellkorb);

            if (!access.HasFeature(ApplicationFeature.AuftragsuebersichtEinsichtsgesucheView))
            {
                items = items.Where(i => i.OrderingType != (int)OrderType.Einsichtsgesuch);
            }

            if (!access.HasFeature(ApplicationFeature.AuftragsuebersichtAuftraegeView))
            {
                items = items.Where(i => i.OrderingType != (int)OrderType.Digitalisierungsauftrag &&
                                    i.OrderingType != (int)OrderType.Lesesaalausleihen &&
                                    i.OrderingType != (int)OrderType.Verwaltungsausleihe);
            }

            return(Ok(items));
        }