public IHttpActionResult PostRelationalDatabaseServices([FromBody] RelationalDatabaseStorageService Service)
 {
     if (!_SecRepo.IsAllowed(User.Identity.Name, "create-services"))
     {
         return(StatusCode(HttpStatusCode.Forbidden));
     }
     return(Ok(_Repo.PostRelationalDatabaseService(Service)));
 }
예제 #2
0
 public IHttpActionResult GetServices()
 {
     if (!_SecRepo.IsAllowed(User.Identity.Name, "create-services"))
     {
         return(StatusCode(HttpStatusCode.Forbidden));
     }
     return(Ok(_Repo.GetServices()));
 }
        public IHttpActionResult GetUsers()
        {
            if (!_SecRepo.IsAllowed(User.Identity.Name, "edit-security-guidelines"))
            {
                return(StatusCode(HttpStatusCode.Forbidden));
            }

            return(Ok(_Repo.GetUsers()));
        }
예제 #4
0
        public IHttpActionResult PostUseCase([FromBody] UseCase useCase)
        {
            if (!_SecRepo.IsAllowed(User.Identity.Name, "manage-use-cases"))
            {
                return(StatusCode(HttpStatusCode.Forbidden));
            }
            var result = _Repo.PostUseCase(useCase);

            if (result.error == null)
            {
                return(Content(result.state, result.content));
            }
            return(Content(result.state, result.error));
        }
예제 #5
0
        public IHttpActionResult PostDataLocationType([FromBody] DataLocationType DataLocationType)
        {
            if (!_SecRepo.IsAllowed(User.Identity.Name, "create-services"))
            {
                return(StatusCode(HttpStatusCode.Forbidden));
            }

            return(Ok(_Repo.PostDataLocationType(DataLocationType)));
        }
예제 #6
0
        public IHttpActionResult PostDeploymentInfo([FromBody] Certificate Certficate)
        {
            if (!_SecRepo.IsAllowed(User.Identity.Name, "create-services"))
            {
                return(StatusCode(HttpStatusCode.Forbidden));
            }

            return(Ok(_Repo.PostCertificate(Certficate)));
        }
        public IHttpActionResult PostProvider([FromBody] Provider Provider)
        {
            if (!_SecRepo.IsAllowed(User.Identity.Name, "create-services"))
            {
                return(StatusCode(HttpStatusCode.Forbidden));
            }

            return(Ok(_Repo.PostProvider(Provider)));
        }
        public IHttpActionResult PostOnlineDriveStorageServices([FromBody] OnlineDriveStorageService Service)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            if (!_SecRepo.IsAllowed(User.Identity.Name, "create-services"))
            {
                return(StatusCode(HttpStatusCode.Forbidden));
            }
            var _Resp = _Repo.PostOnlineDriveStorageService(Service);

            if (_Resp == null)
            {
                return(NotFound());
            }
            return(Ok(_Resp));
        }
예제 #9
0
        public IHttpActionResult PostServiceModel([FromBody] CloudServiceModel ServiceModel)
        {
            if (!_SecRepo.IsAllowed(User.Identity.Name, "create-services"))
            {
                return(StatusCode(HttpStatusCode.Forbidden));
            }

            return(Ok(_Repo.PostServiceModel(ServiceModel)));
        }