Rename DisallowCreationAndDeletionOfUserBranches

DisallowCreationAndDeletionOfUserBranches no longer applies to user
branches only, but also disallows the creation and deletion of group
branches. Give it a more generic name.

Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: I73d37a59b68d68c062376da114de3762bdd08461
This commit is contained in:
Edwin Kempin
2019-02-01 12:38:27 +01:00
parent c95a285ec3
commit 8a5abacfd6

View File

@@ -77,7 +77,8 @@ public class RefOperationValidators {
boolean withException = false;
try {
messages.addAll(
new DisallowCreationAndDeletionOfUserBranches(perm, allUsersName).onRefOperation(event));
new DisallowCreationAndDeletionOfGerritMaintainedBranches(perm, allUsersName)
.onRefOperation(event));
refOperationValidationListeners.runEach(
l -> l.onRefOperation(event), ValidationException.class);
} catch (ValidationException e) {
@@ -110,12 +111,12 @@ public class RefOperationValidators {
}
}
private static class DisallowCreationAndDeletionOfUserBranches
private static class DisallowCreationAndDeletionOfGerritMaintainedBranches
implements RefOperationValidationListener {
private final PermissionBackend.WithUser perm;
private final AllUsersName allUsersName;
DisallowCreationAndDeletionOfUserBranches(
DisallowCreationAndDeletionOfGerritMaintainedBranches(
PermissionBackend.WithUser perm, AllUsersName allUsersName) {
this.perm = perm;
this.allUsersName = allUsersName;