Make the ManualRequestContext constructor public for e.g. plugin access
Change the access modifier from default (package-private) to public for the com.google.gerrit.server.util.ManualRequestContext constructor. This is so that plugins can also benefit from this server.util class to build custom ManualRequestContext-s. Doing so allows plugins to, e.g., replace the user within a RequestContext with another, super-user (like) one. The other case being, the ability to replace the db provider with another. All this within an AutoClosable -hence safer- implementation. Change-Id: I3963c587d759bb28a2044ea029e73dfd8f576ba7
This commit is contained in:
@@ -31,7 +31,7 @@ public class ManualRequestContext implements RequestContext, AutoCloseable {
|
||||
private final ThreadLocalRequestContext requestContext;
|
||||
private final RequestContext old;
|
||||
|
||||
ManualRequestContext(CurrentUser user, SchemaFactory<ReviewDb> schemaFactory,
|
||||
public ManualRequestContext(CurrentUser user, SchemaFactory<ReviewDb> schemaFactory,
|
||||
ThreadLocalRequestContext requestContext) throws OrmException {
|
||||
this.user = user;
|
||||
this.db = Providers.of(schemaFactory.open());
|
||||
|
Reference in New Issue
Block a user