Remove support for initial groups from PerformCreateGroup
Nobody is using this functionality anymore. Change-Id: I0516cfa15c34f1db1e19abbcacfdbaa43e6ae106 Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
committed by
Edwin Kempin
parent
13c95641d5
commit
5a65c8529f
@@ -25,7 +25,6 @@ public class CreateGroupArgs {
|
||||
public boolean visibleToAll;
|
||||
public AccountGroup.Id ownerGroupId;
|
||||
public Collection<? extends Account.Id> initialMembers;
|
||||
public Collection<? extends AccountGroup.UUID> initialGroups;
|
||||
|
||||
public AccountGroup.NameKey getGroup() {
|
||||
return groupName;
|
||||
|
||||
@@ -19,7 +19,6 @@ import com.google.gerrit.common.errors.NameAlreadyUsedException;
|
||||
import com.google.gerrit.common.errors.PermissionDeniedException;
|
||||
import com.google.gerrit.reviewdb.client.Account;
|
||||
import com.google.gerrit.reviewdb.client.AccountGroup;
|
||||
import com.google.gerrit.reviewdb.client.AccountGroupById;
|
||||
import com.google.gerrit.reviewdb.client.AccountGroupMember;
|
||||
import com.google.gerrit.reviewdb.client.AccountGroupName;
|
||||
import com.google.gerrit.reviewdb.server.ReviewDb;
|
||||
@@ -45,7 +44,6 @@ public class PerformCreateGroup {
|
||||
|
||||
private final ReviewDb db;
|
||||
private final AccountCache accountCache;
|
||||
private final GroupIncludeCache groupIncludeCache;
|
||||
private final IdentifiedUser currentUser;
|
||||
private final PersonIdent serverIdent;
|
||||
private final GroupCache groupCache;
|
||||
@@ -54,12 +52,11 @@ public class PerformCreateGroup {
|
||||
|
||||
@Inject
|
||||
PerformCreateGroup(ReviewDb db, AccountCache accountCache,
|
||||
GroupIncludeCache groupIncludeCache, IdentifiedUser currentUser,
|
||||
@GerritPersonIdent PersonIdent serverIdent, GroupCache groupCache,
|
||||
@Assisted CreateGroupArgs createGroupArgs, AuditService auditService) {
|
||||
IdentifiedUser currentUser, @GerritPersonIdent PersonIdent serverIdent,
|
||||
GroupCache groupCache, @Assisted CreateGroupArgs createGroupArgs,
|
||||
AuditService auditService) {
|
||||
this.db = db;
|
||||
this.accountCache = accountCache;
|
||||
this.groupIncludeCache = groupIncludeCache;
|
||||
this.currentUser = currentUser;
|
||||
this.serverIdent = serverIdent;
|
||||
this.groupCache = groupCache;
|
||||
@@ -114,11 +111,6 @@ public class PerformCreateGroup {
|
||||
|
||||
addMembers(groupId, createGroupArgs.initialMembers);
|
||||
|
||||
if (createGroupArgs.initialGroups != null) {
|
||||
addGroups(groupId, createGroupArgs.initialGroups);
|
||||
groupIncludeCache.evictSubgroupsOf(uuid);
|
||||
}
|
||||
|
||||
groupCache.onCreateGroup(createGroupArgs.getGroup());
|
||||
|
||||
return group;
|
||||
@@ -139,20 +131,4 @@ public class PerformCreateGroup {
|
||||
accountCache.evict(accountId);
|
||||
}
|
||||
}
|
||||
|
||||
private void addGroups(final AccountGroup.Id groupId,
|
||||
final Collection<? extends AccountGroup.UUID> groups) throws OrmException {
|
||||
List<AccountGroupById> includeList = new ArrayList<>();
|
||||
for (AccountGroup.UUID includeUUID : groups) {
|
||||
final AccountGroupById groupInclude =
|
||||
new AccountGroupById(new AccountGroupById.Key(groupId, includeUUID));
|
||||
includeList.add(groupInclude);
|
||||
}
|
||||
db.accountGroupById().insert(includeList);
|
||||
auditService.dispatchAddGroupsToGroup(currentUser.getAccountId(), includeList);
|
||||
|
||||
for (AccountGroup.UUID uuid : groups) {
|
||||
groupIncludeCache.evictParentGroupsOf(uuid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user