Ejemplo n.º 1
0
        public async Task <ActionResult <StockItem> > GetStockItem(Guid id)
        {
            var stockItem = await _stockItemsService.GetStockItem(id);

            if (stockItem is null)
            {
                return(NotFound());
            }

            await _posAuthLoader.AssertResourceAccessAsync(User, stockItem.PointOfSaleId, IsAuthorizedUserPolicy.Instance);

            return(stockItem);
        }
Ejemplo n.º 2
0
        public async Task <IUserAuthorizationLevel> LoadUserAuthorizationLevel(Guid userId, Guid resourceId)
        {
            var stockItem = await _stockItemsService.GetStockItem(resourceId);

            if (stockItem is null)
            {
                return(null);
            }
            else
            {
                return(await _posAuthLoader.LoadUserAuthorizationLevel(userId, stockItem.PointOfSaleId));
            }
        }