mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
@@ -31,10 +31,12 @@ func AuthAny(c *gin.Context, resource acl.Resource, grants acl.Permissions) (s *
|
||||
if s = Session(clientIp, authToken); s == nil {
|
||||
event.AuditWarn([]string{clientIp, "unauthenticated", "%s %s", "denied"}, grants.String(), string(resource))
|
||||
return entity.SessionStatusUnauthorized()
|
||||
} else {
|
||||
s.SetClientIP(clientIp)
|
||||
}
|
||||
|
||||
// Disable caching of responses and the client IP.
|
||||
c.Header(header.CacheControl, header.CacheControlNoStore)
|
||||
s.SetClientIP(clientIp)
|
||||
|
||||
// If the request is from a client application, check its authorization based
|
||||
// on the allowed scope, the ACL, and the user account it belongs to (if any).
|
||||
if s.IsClient() {
|
||||
|
||||
Reference in New Issue
Block a user