Access control: expose SA frontend to users with the right permissions (#47727)
* expose frontend to users with permissions * cover the ui endpoints * fix permissions
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
ac "github.com/grafana/grafana/pkg/services/accesscontrol"
|
||||
"github.com/grafana/grafana/pkg/services/dashboards"
|
||||
"github.com/grafana/grafana/pkg/services/datasources"
|
||||
"github.com/grafana/grafana/pkg/services/serviceaccounts"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
)
|
||||
|
||||
@@ -462,6 +463,12 @@ var teamsEditAccessEvaluator = ac.EvalAll(
|
||||
),
|
||||
)
|
||||
|
||||
// apiKeyAccessEvaluator is used to protect the "Configuration > API keys" page access
|
||||
var apiKeyAccessEvaluator = ac.EvalPermission(ac.ActionAPIKeyRead)
|
||||
|
||||
// serviceAccountAccessEvaluator is used to protect the "Configuration > Service accounts" page access
|
||||
var serviceAccountAccessEvaluator = ac.EvalPermission(serviceaccounts.ActionRead)
|
||||
|
||||
// Metadata helpers
|
||||
// getAccessControlMetadata returns the accesscontrol metadata associated with a given resource
|
||||
func (hs *HTTPServer) getAccessControlMetadata(c *models.ReqContext,
|
||||
|
||||
Reference in New Issue
Block a user