Package com.google.gerrit.server.project
Class CreateRefControl
java.lang.Object
com.google.gerrit.server.project.CreateRefControl
Manages access control for creating Git references (aka branches, tags).
-
Method Summary
Modifier and TypeMethodDescriptionvoid
checkCreateRef
(com.google.inject.Provider<? extends CurrentUser> user, org.eclipse.jgit.lib.Repository repo, BranchNameKey destBranch, org.eclipse.jgit.revwalk.RevObject object, boolean forPush, BranchNameKey... sourceBranches) Checks whether theCurrentUser
can create a new Git ref.
-
Method Details
-
checkCreateRef
public void checkCreateRef(com.google.inject.Provider<? extends CurrentUser> user, org.eclipse.jgit.lib.Repository repo, BranchNameKey destBranch, org.eclipse.jgit.revwalk.RevObject object, boolean forPush, BranchNameKey... sourceBranches) throws AuthException, PermissionBackendException, NoSuchProjectException, IOException, ResourceConflictException Checks whether theCurrentUser
can create a new Git ref.- Parameters:
user
- the user performing the operationrepo
- repository on which user want to createdestBranch
- the branch the newRevObject
should be created onobject
- the object the user will start the reference withsourceBranches
- the source ref from which the new ref is created from- Throws:
AuthException
- if creation is denied; the message explains the denial.PermissionBackendException
- on failure of permission checks.ResourceConflictException
- if the project state does not permit the operationNoSuchProjectException
IOException
-