Files
gerrit/java/com/google/gerrit/extensions/config/PluginProjectPermissionDefinition.java
Changcheng Xiao 8673c3b667 Allow plugins to declare project permissions
This commit makes it possible for plugins to declare
project permissions like what they are doing for
capabilities.

In the access section of a "project.config" file,
a plugin delcared permission is stored in a format
like "plugin-{pluginName}-{permission}" so that we
can tell if a config name could possibly be a plugin
permission with some confidence. This is helpful
when we load/save "ProjectConfig" where listing
plugin defined permissions is not trivial, e.g.
DynamicMap doesn't present when a test site is
initialized.

Note plugin declared capabilities have to keep the
old format "{plugin-name}-capability" before a data
migration is done.

In the child commit, we are going to extend
the "PermissionBackend" to accept project permissions
declared by plugins.

Change-Id: I977a77286f56214f90a5ff6a5b482e2701cf9916
2019-03-05 17:34:00 +01:00

22 lines
896 B
Java

// Copyright (C) 2019 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.extensions.config;
import com.google.gerrit.extensions.annotations.ExtensionPoint;
/** Specifies a repository permission declared by a plugin. */
@ExtensionPoint
public abstract class PluginProjectPermissionDefinition implements PluginPermissionDefinition {}