Class RepositoryController
java.lang.Object
edu.ucsb.cs156.frontiers.controllers.ApiController
edu.ucsb.cs156.frontiers.controllers.RepositoryController
@RestController
@RequestMapping("/api/repos")
public class RepositoryController
extends ApiController
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateRepos
(Long courseId, String repoPrefix, Optional<Boolean> isPrivate, RepositoryPermissions permissions) Fires a job that creates a repo for every RosterStudent with a linked user with a GitHub account.Methods inherited from class edu.ucsb.cs156.frontiers.controllers.ApiController
doesCurrentUserHaveRole, genericMessage, getCurrentUser, handleEntityNotFoundException, handleIllegalArgument, handleNoLinkedOrgException, handleUnsupportedOperation, isCurrentUserAdmin
-
Constructor Details
-
RepositoryController
public RepositoryController()
-
-
Method Details
-
createRepos
@PostMapping("/createRepos") @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)") public Job createRepos(@RequestParam Long courseId, @RequestParam String repoPrefix, @RequestParam Optional<Boolean> isPrivate, @RequestParam RepositoryPermissions permissions) Fires a job that creates a repo for every RosterStudent with a linked user with a GitHub account.- Parameters:
courseId
- ID of course to create repos forrepoPrefix
- each repo created will begin with this prefix, followed by a dash and the student's GitHub usernameisPrivate
- determines whether the repository being created is private- Returns:
- the
Job
started to create the repos.
-