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); }
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)); } }