mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Authn: Identity resolvers (#85930)
* AuthN: Add NamespaceID struct. We should replace the usage of encoded namespaceID with this one * AuthN: Add optional interface that clients can implement to be able to resolve identity for a namespace * Authn: Implement IdentityResolverClient for api keys * AuthN: use idenity resolvers Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
This commit is contained in:
@@ -175,7 +175,9 @@ func HasGlobalAccess(ac AccessControl, authnService authn.Service, c *contextmod
|
||||
var targetOrgID int64 = GlobalOrgID
|
||||
orgUser, err := authnService.ResolveIdentity(c.Req.Context(), targetOrgID, c.SignedInUser.GetID())
|
||||
if err != nil {
|
||||
deny(c, nil, fmt.Errorf("failed to authenticate user in target org: %w", err))
|
||||
// This will be an common error for entities that can't authenticate in global scope
|
||||
c.Logger.Debug("Failed to authenticate user in global scope", "error", err)
|
||||
return false
|
||||
}
|
||||
|
||||
hasAccess, err := ac.Evaluate(c.Req.Context(), orgUser, evaluator)
|
||||
|
||||
Reference in New Issue
Block a user