Remove isVisibleToAll from GroupDescription
The notion of who can view a group is a security detail that belongs delegated to the group backend and should not be part of the public GroupDescription.Basic interface. Drop it and move the code into the internal group backend only. Change-Id: Ia967e957147860fe98d1a4d74b005d63f48e4343
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user