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:
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user