mirror of
https://github.com/photoprism/photoprism.git
synced 2026-01-23 02:24:24 +00:00
Auth: Improve readability of clientRole() in entity/auth_session.go
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
parent
f696f0325e
commit
30c584559c
1 changed files with 4 additions and 6 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue