Move system groups into their own backend

Delete 'Anonymous Users', 'Registered Users', 'Project Owners' and
'Change Owner' from the database and account_groups table.  Define
them inside of a specialized SystemGroupBackend class.

Change-Id: Ia67add4630579f3d0ce25edcfd662bbcf918dc8f
This commit is contained in:
Shawn Pearce
2013-12-02 11:26:13 -08:00
parent 7f1bb28e9a
commit f43e915c5d
41 changed files with 409 additions and 398 deletions

View File

@@ -803,8 +803,7 @@ public class Dispatcher {
// for external and system groups the members cannot be
// shown in the web UI).
//
if (AccountGroup.isInternalGroup(group.getGroupUUID())
&& !AccountGroup.isSystemGroup(group.getGroupUUID())) {
if (AccountGroup.isInternalGroup(group.getGroupUUID())) {
Gerrit.display(toGroup(group.getGroupId(), AccountGroupScreen.MEMBERS),
new AccountGroupMembersScreen(group, token));
} else {

View File

@@ -214,8 +214,7 @@ public class AccountGroupInfoScreen extends AccountGroupScreen {
ownerTxt.setText(group.owner() != null?group.owner():Util.M.deletedReference(group.getOwnerUUID().get()));
descTxt.setText(group.description());
visibleToAllCheckBox.setValue(group.options().isVisibleToAll());
setMembersTabVisible(AccountGroup.isInternalGroup(group.getGroupUUID())
&& !AccountGroup.isSystemGroup(group.getGroupUUID()));
setMembersTabVisible(AccountGroup.isInternalGroup(group.getGroupUUID()));
enableForm(canModify);
saveName.setVisible(canModify);

View File

@@ -149,8 +149,7 @@ public class AccountGroupMembersScreen extends AccountGroupScreen {
@Override
protected void display(final GroupInfo group, final boolean canModify) {
if (AccountGroup.isInternalGroup(group.getGroupUUID())
&& !AccountGroup.isSystemGroup(group.getGroupUUID())) {
if (AccountGroup.isInternalGroup(group.getGroupUUID())) {
members.display(Natives.asList(group.members()));
includes.display(Natives.asList(group.includes()));
} else {

View File

@@ -37,8 +37,7 @@ public abstract class AccountGroupScreen extends MenuScreen {
link(Util.C.groupTabGeneral(), getTabToken(token, INFO));
link(Util.C.groupTabMembers(), membersTabToken,
AccountGroup.isInternalGroup(group.getGroupUUID())
&& !AccountGroup.isSystemGroup(group.getGroupUUID()));
AccountGroup.isInternalGroup(group.getGroupUUID()));
}
private String getTabToken(final String token, final String tab) {