Apply @RequiresCapability to REST API

Move the @RequiresCapability from SSHD to gerrit-extension-api. Modify
the RestApiServlet to check the current user has the required
capabilities. All RestApiServlets must now inject the currentUser
provider in their constructor and pass it to the super class.

Signed-off-by: Brad Larson <bklarson@gmail.com>
Change-Id: Iffc9bc99b8d2fafd07bf624008719b0ec647ce7d
This commit is contained in:
Brad Larson
2012-05-15 16:58:01 -05:00
parent 2d872ebff2
commit ff7eef0399
20 changed files with 66 additions and 19 deletions

View File

@@ -16,6 +16,7 @@ package com.google.gerrit.sshd;
import com.google.common.collect.Sets;
import com.google.common.util.concurrent.Atomics;
import com.google.gerrit.extensions.annotations.RequiresCapability;
import com.google.gerrit.server.CurrentUser;
import com.google.gerrit.server.account.CapabilityControl;
import com.google.gerrit.sshd.args4j.SubcommandHandler;