mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Auth: Reduce restriction with non-user accounts (#74397)
* Reduce restrictions with non-user accounts * Revert restrictions on anonymous accounts * Change log level from warning to debug * Change log messages to upper case
This commit is contained in:
@@ -300,15 +300,11 @@ func ProvideService(plugCtxProvider *plugincontext.Provider, cfg *setting.Cfg, r
|
||||
|
||||
g.websocketHandler = func(ctx *contextmodel.ReqContext) {
|
||||
user := ctx.SignedInUser
|
||||
namespaceID, userID := user.GetNamespacedID()
|
||||
|
||||
if namespaceID != identity.NamespaceUser {
|
||||
return // Only users can connect to Live
|
||||
}
|
||||
_, identifier := user.GetNamespacedID()
|
||||
|
||||
// Centrifuge expects Credentials in context with a current user ID.
|
||||
cred := ¢rifuge.Credentials{
|
||||
UserID: userID,
|
||||
UserID: identifier,
|
||||
}
|
||||
newCtx := centrifuge.SetCredentials(ctx.Req.Context(), cred)
|
||||
newCtx = livecontext.SetContextSignedUser(newCtx, user)
|
||||
|
Reference in New Issue
Block a user