예제 #1
0
        public async Task <IQueryable <Deployment> > EnableDeployment(
            [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.Enable(deployment);

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