1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-23 00:55:58 +01:00

Don't set permissions if clients overrides.

This commit is contained in:
Juliusz Chroboczek 2020-11-29 16:42:42 +01:00
parent 1ed2540bd7
commit 4b420e5bd6

View file

@ -269,19 +269,17 @@ func AddClient(name string, c Client) (*Group, error) {
return nil, err return nil, err
} }
override := c.OverridePermissions(g)
g.mu.Lock() g.mu.Lock()
defer g.mu.Unlock() defer g.mu.Unlock()
if(!c.OverridePermissions(g)) {
perms, err := g.description.GetPermission(c.Credentials()) perms, err := g.description.GetPermission(c.Credentials())
if !override && err != nil { if err != nil {
return nil, err return nil, err
} }
c.SetPermissions(perms) c.SetPermissions(perms)
if !override {
if !perms.Op && g.locked != nil { if !perms.Op && g.locked != nil {
m := *g.locked m := *g.locked
if m == "" { if m == "" {