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))); }
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))); }