Beispiel #1
0
        public async Task <IActionResult> AddProject([FromBody] UpsertProjectParams ps)
        {
            if (!await _permissionService.HasGlobalPermissionAsync(Permission.Admin))
            {
                return(StatusCode(403, "You have no permission to add project."));
            }

            return(Ok(await _projectService.AddProjectAsync(ps)));
        }
Beispiel #2
0
        public async Task <IActionResult> UpdateProject([FromRoute] string projectKey, [FromBody] UpsertProjectParams ps)
        {
            if (!await _permissionService.HasProjectPermissionAsync(projectKey, Permission.Admin))
            {
                return(StatusCode(403, "You have no permission to update this project."));
            }

            ps.ProjectKey = projectKey;
            return(Ok(await _projectService.UpdateProjectAsync(ps)));
        }