コード例 #1
0
ファイル: Mutation.cs プロジェクト: jkelin/supercompose
        public async Task <IQueryable <Deployment> > DisableDeployment(
            [Required] Guid deployment,
            [GlobalState("ClaimsPrincipal")] ClaimsPrincipal user
            )
        {
            var deploymentAuth =
                await authorizationService.AuthorizeAsync(user, deployment,
                                                          new TenantDeploymentRequirement());

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

            await deploymentService.Disable(deployment);

            return(ctxFactiry.CreateDbContext().Deployments.Where(x => x.Id == deployment));
        }