[management] Prevent removal of All group from peers during user groups propagation (#2410)

* Prevent removal of "All" group from peers

* Prevent adding "All" group to users and setup keys

* Refactor setup key group validation
This commit is contained in:
Bethuel Mmbaga
2024-08-12 13:48:05 +03:00
committed by GitHub
parent 15eb752a7d
commit 539480a713
4 changed files with 59 additions and 11 deletions

View File

@@ -922,7 +922,7 @@ func (a *Account) UserGroupsAddToPeers(userID string, groups ...string) {
func (a *Account) UserGroupsRemoveFromPeers(userID string, groups ...string) {
for _, gid := range groups {
group, ok := a.Groups[gid]
if !ok {
if !ok || group.Name == "All" {
continue
}
update := make([]string, 0, len(group.Peers))