Enable plugin-based validation of user's ref related operations

After user is authorized to perform a given ref operation, but just
before it is performed, invoke validation from plugins.

Validation is invoked for ref create, delete and update (including
non-ff) operations caused by user through either push or call to
existing ref related Gerrit endpoints (create/delete branch/es).

Change-Id: I11cbe51f54e7d133b336ab503577653b6fe0f443
Signed-off-by: Jacek Centkowski <geminica.programs@gmail.com>
This commit is contained in:
Jacek Centkowski
2014-09-10 07:53:51 -04:00
parent bc425ff53b
commit 0b9424690d
7 changed files with 125 additions and 11 deletions

View File

@@ -69,6 +69,7 @@ public class Module extends RestApiModule {
post(PROJECT_KIND, "branches:delete").to(DeleteBranches.class);
factory(CreateBranch.Factory.class);
get(BRANCH_KIND, "mergeable").to(CheckMergeability.class);
factory(RefValidationHelper.Factory.class);
get(BRANCH_KIND, "reflog").to(GetReflog.class);
child(BRANCH_KIND, "files").to(FilesCollection.class);
get(FILE_KIND, "content").to(GetContent.class);