Alerting: Fix anonymous access to alerting (#49203)
* introduce a fallback handler that checks that role is Viewer. * update UI nav links to allow alerting tabs for anonymous user * update rule api to check for Viewer role instead of SignedIn when RBAC is disabled
This commit is contained in:
@@ -129,6 +129,11 @@ var ReqGrafanaAdmin = func(c *models.ReqContext) bool {
|
||||
return c.IsGrafanaAdmin
|
||||
}
|
||||
|
||||
// ReqViewer returns true if the current user has models.ROLE_VIEWER. Note: this can be anonymous user as well
|
||||
var ReqViewer = func(c *models.ReqContext) bool {
|
||||
return c.OrgRole.Includes(models.ROLE_VIEWER)
|
||||
}
|
||||
|
||||
var ReqOrgAdmin = func(c *models.ReqContext) bool {
|
||||
return c.OrgRole == models.ROLE_ADMIN
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user