Auth: Improve readability of clientRole() in entity/auth_session.go

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer 2025-10-29 08:09:09 +01:00
parent f696f0325e
commit 30c584559c

View file

@ -354,13 +354,11 @@ func (m *Session) clientRole(resolve bool) acl.Role {
return c.AclRole()
}
if !resolve {
if !resolve || m.ClientUID == "" {
// Skip lookup to avoid recursive loop.
} else if uid := m.ClientUID; uid != "" {
if c := FindClientByUID(uid); c != nil {
m.SetClient(c)
return c.AclRole()
}
} else if c := FindClientByUID(m.ClientUID); c != nil {
m.SetClient(c)
return c.AclRole()
}
if m.IsClient() {