mirror of
https://github.com/grafana/grafana.git
synced 2026-08-13 06:34:55 -05:00
Dashboards: Don't set dashboard creator/updater if the action is done by an API key (#87704)
don't parse userID if entity isn't user or service account
This commit is contained in:
@@ -236,13 +236,14 @@ func resolveUserID(user identity.Requester, log log.Logger) (int64, error) {
|
||||
namespaceID, identifier := user.GetNamespacedID()
|
||||
if namespaceID != identity.NamespaceUser && namespaceID != identity.NamespaceServiceAccount {
|
||||
log.Debug("User does not belong to a user or service account namespace", "namespaceID", namespaceID, "userID", identifier)
|
||||
} else {
|
||||
var err error
|
||||
userID, err = identity.IntIdentifier(namespaceID, identifier)
|
||||
if err != nil {
|
||||
log.Debug("failed to parse user ID", "namespaceID", namespaceID, "userID", identifier, "error", err)
|
||||
}
|
||||
}
|
||||
|
||||
userID, err := identity.IntIdentifier(namespaceID, identifier)
|
||||
|
||||
if err != nil {
|
||||
log.Debug("failed to parse user ID", "namespaceID", namespaceID, "userID", identifier, "error", err)
|
||||
}
|
||||
return userID, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user