Пример #1
0
        public async Task <IQueryable <Node> > DisableNode(
            [Required] Guid node,
            [GlobalState("ClaimsPrincipal")] ClaimsPrincipal user
            )
        {
            var deploymentAuth =
                await authorizationService.AuthorizeAsync(user, node,
                                                          new TenantNodeRequirement());

            if (deploymentAuth.Failure != null)
            {
                throw new UnauthorizedAccessException();
            }

            await nodeService.Disable(node);

            return(ctxFactiry.CreateDbContext().Nodes.Where(x => x.Id == node));
        }