Add capability.administrateServer to gerrit.config

This provides a fail-safe in case an administrator deletes all
administrateServer entries from All-Projects.

In a default installation of Gerrit Code Review all administrators are
locked out and recovery must happen by directly modifying the
refs/meta/config branch in All-Projects "behind Gerrit's back".  In
some hosted installations this option may not be available to the
administrators, as the UNIX account is managed by a different group.

By adding a fail-safe group to gerrit.config the administrators are
always able to use the REST API and web interface to manage the
server, even if all entries were accidentally removed or incorrectly
specified in All-Projects.

Change-Id: I3083dc2997061ce7be095fb53f187856ab8ed0df
This commit is contained in:
Shawn Pearce
2016-08-11 11:51:59 -07:00
parent afbc603265
commit 67a3330950
10 changed files with 226 additions and 43 deletions

View File

@@ -0,0 +1,34 @@
// Copyright (C) 2010 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License
package com.google.gerrit.server.config;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import com.google.inject.BindingAnnotation;
import java.lang.annotation.Retention;
/**
* Groups that can always exercise {@code administrateServer} capability.
*
* <pre>
* [capability]
* administrateServer = group Administrators
* </pre>
*/
@Retention(RUNTIME)
@BindingAnnotation
public @interface AdministrateServerGroups {
}