Пример #1
0
        protected override async Task HandleRequirementAsync(AuthorizationHandlerContext context, PosExistsRequirement requirement)
        {
            if (!context.User.HasClaim(c => c.Type == Claims.PointOfSaleId))
            {
                context.Fail();
                return;
            }

            var posId        = context.User.GetPointOfSaleId();
            var httpResponse = await _posService.StatPointOfSale(posId);

            if (httpResponse.IsSuccessStatusCode)
            {
                context.Succeed(requirement);
            }
            else
            {
                context.Fail();
            }
        }
Пример #2
0
 protected override async Task <HttpResponseMessage> MakeRequest(Guid id)
 => await _service.StatPointOfSale(id);