Add /config/check.access endpoint
The check.access endpoint is for administrative users. It can be supplied with a (project, account) or (project, account, ref) tuple to check that ACLs are behaving as expected. Change-Id: Icf74b0fc4036312eef9f222aaff8e1769a051eec
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
// Copyright (C) 2017 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.api.config;
|
||||
|
||||
public class AccessCheckInfo {
|
||||
public static class Result {
|
||||
public String message;
|
||||
|
||||
// HTTP status code.
|
||||
public int status;
|
||||
}
|
||||
|
||||
public Result result;
|
||||
// for future extension, we may add inputs / results for bulk checks.
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Copyright (C) 2017 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.api.config;
|
||||
|
||||
import com.google.gerrit.common.Nullable;
|
||||
|
||||
public class AccessCheckInput {
|
||||
public String account;
|
||||
public String project;
|
||||
|
||||
@Nullable public String ref;
|
||||
|
||||
public AccessCheckInput(String account, String project, @Nullable String ref) {
|
||||
this.account = account;
|
||||
this.project = project;
|
||||
this.ref = ref;
|
||||
}
|
||||
|
||||
public AccessCheckInput() {
|
||||
}
|
||||
}
|
||||
@@ -36,6 +36,8 @@ public interface Server {
|
||||
|
||||
ConsistencyCheckInfo checkConsistency(ConsistencyCheckInput in) throws RestApiException;
|
||||
|
||||
AccessCheckInfo checkAccess(AccessCheckInput in) throws RestApiException;
|
||||
|
||||
/**
|
||||
* A default implementation which allows source compatibility when adding new methods to the
|
||||
* interface.
|
||||
@@ -75,5 +77,10 @@ public interface Server {
|
||||
public ConsistencyCheckInfo checkConsistency(ConsistencyCheckInput in) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccessCheckInfo checkAccess(AccessCheckInput in) throws RestApiException {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user