summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2021-03-08 18:26:00 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2021-03-08 18:35:35 +0100
commit3233b9197abdb2b39af7aad4221c50784b79f4ce (patch)
treeb2f3c23daafc1ce5d02083bfb931133828475c3e
parent817d09bdc8021e0c5b4ebc4d517b4d7fb884d4ca (diff)
Ensure InternalUser can parse groups
When the serviceuser plugin tries to resolve the service user's owner group when ReceiveCommit runs asynchronously using AsyncReceiveCommits GroupsCollection#parse fails since it doesn't consider that the internal user may call it. See Idb9ba5bcbd38cd5c81cc90731397b75290b31ea7. Bug: Issue 14193 Change-Id: I442374b729f11e15cc3f61180dc06e2a3bd5b707
-rw-r--r--java/com/google/gerrit/server/restapi/group/GroupsCollection.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/java/com/google/gerrit/server/restapi/group/GroupsCollection.java b/java/com/google/gerrit/server/restapi/group/GroupsCollection.java
index 65a7f4f9df..fd7bc26a07 100644
--- a/java/com/google/gerrit/server/restapi/group/GroupsCollection.java
+++ b/java/com/google/gerrit/server/restapi/group/GroupsCollection.java
@@ -87,7 +87,7 @@ public class GroupsCollection
final CurrentUser user = self.get();
if (user instanceof AnonymousUser) {
throw new AuthException("Authentication required");
- } else if (!(user.isIdentifiedUser())) {
+ } else if (!(user.isIdentifiedUser() || user.isInternalUser())) {
throw new ResourceNotFoundException(id);
}