Merge "Remove isVisibleToAll from GroupDescription"
This commit is contained in:
commit
54909a0242
@ -32,9 +32,6 @@ public class GroupDescription {
|
||||
/** @return the non-null name of the group. */
|
||||
String getName();
|
||||
|
||||
/** @return whether the group is visible to all accounts. */
|
||||
boolean isVisibleToAll();
|
||||
|
||||
/**
|
||||
* @return optional email address to send to the group's members. If
|
||||
* provided, Gerrit will use this email address to send
|
||||
|
@ -44,11 +44,6 @@ public class GroupDescriptions {
|
||||
return group.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisibleToAll() {
|
||||
return group.isVisibleToAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccountGroup getAccountGroup() {
|
||||
return group;
|
||||
|
@ -103,7 +103,8 @@ public class GroupControl {
|
||||
|
||||
/** Can this user see this group exists? */
|
||||
public boolean isVisible() {
|
||||
return group.isVisibleToAll()
|
||||
AccountGroup accountGroup = GroupDescriptions.toAccountGroup(group);
|
||||
return (accountGroup != null && accountGroup.isVisibleToAll())
|
||||
|| user.getEffectiveGroups().contains(group.getGroupUUID())
|
||||
|| isOwner();
|
||||
}
|
||||
@ -149,6 +150,8 @@ public class GroupControl {
|
||||
}
|
||||
|
||||
private boolean canSeeMembers() {
|
||||
return group.isVisibleToAll() || isOwner();
|
||||
AccountGroup accountGroup = GroupDescriptions.toAccountGroup(group);
|
||||
return (accountGroup != null && accountGroup.isVisibleToAll())
|
||||
|| isOwner();
|
||||
}
|
||||
}
|
||||
|
@ -149,11 +149,6 @@ public class LdapGroupBackend implements GroupBackend {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisibleToAll() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public String getEmailAddress() {
|
||||
|
@ -15,6 +15,7 @@
|
||||
package com.google.gerrit.server.group;
|
||||
|
||||
import com.google.gerrit.common.data.GroupDescription;
|
||||
import com.google.gerrit.common.data.GroupDescriptions;
|
||||
import com.google.gerrit.reviewdb.client.AccountGroup;
|
||||
|
||||
public class GroupOptionsInfo {
|
||||
@ -22,7 +23,8 @@ public class GroupOptionsInfo {
|
||||
public Boolean visibleToAll;
|
||||
|
||||
public GroupOptionsInfo(GroupDescription.Basic group) {
|
||||
visibleToAll = group.isVisibleToAll() ? true : null;
|
||||
AccountGroup ag = GroupDescriptions.toAccountGroup(group);
|
||||
visibleToAll = ag != null && ag.isVisibleToAll() ? true : null;
|
||||
}
|
||||
|
||||
public GroupOptionsInfo(AccountGroup group) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user