Support defaults for general preferences in All-Users
The All-Users repository contains a refs/users/default branch for configuring defaults that apply to all users. It already has a preferences.config file for configuring default preferences that overwrite the defaults that are hard-coded in Gerrit. However so far only defaults for diff preferences and my menu entries are supported. With this change defaults for all general preferences are supported. When comparing preferences in the test we exclude the my menus because GeneralPreferencesInfo.defaults() doesn't contain the my menu defaults, but they are computed on the fly. General preferences are stored in the accounts, this is why we need to flush the account cache when the defaults for the general preferences are changed. Change-Id: Icdea2bf81ce1a49aba095735099b9bfcafad5a73 Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
package com.google.gerrit.extensions.api.config;
|
||||
|
||||
import com.google.gerrit.extensions.client.DiffPreferencesInfo;
|
||||
import com.google.gerrit.extensions.client.GeneralPreferencesInfo;
|
||||
import com.google.gerrit.extensions.restapi.NotImplementedException;
|
||||
import com.google.gerrit.extensions.restapi.RestApiException;
|
||||
|
||||
@@ -24,6 +25,9 @@ public interface Server {
|
||||
*/
|
||||
String getVersion() throws RestApiException;
|
||||
|
||||
GeneralPreferencesInfo getDefaultPreferences() throws RestApiException;
|
||||
GeneralPreferencesInfo setDefaultPreferences(GeneralPreferencesInfo in)
|
||||
throws RestApiException;
|
||||
DiffPreferencesInfo getDefaultDiffPreferences() throws RestApiException;
|
||||
DiffPreferencesInfo setDefaultDiffPreferences(DiffPreferencesInfo in)
|
||||
throws RestApiException;
|
||||
@@ -38,6 +42,18 @@ public interface Server {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public GeneralPreferencesInfo getDefaultPreferences()
|
||||
throws RestApiException {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public GeneralPreferencesInfo setDefaultPreferences(
|
||||
GeneralPreferencesInfo in) throws RestApiException {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DiffPreferencesInfo getDefaultDiffPreferences()
|
||||
throws RestApiException {
|
||||
|
Reference in New Issue
Block a user