mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
RBAC: Cover plugin includes (#57582)
* RBAC: Add action to plugin includes * Adding the feature toggle check * Cue update * Extract include access control to method * Suggestion to prevent log when RBAC is disabled Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com> * Rename IsRBACReady to RequireRBACAction Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>
This commit is contained in:
@@ -87,6 +87,7 @@ type Includes struct {
|
||||
Type string `json:"type"`
|
||||
Component string `json:"component"`
|
||||
Role org.RoleType `json:"role"`
|
||||
Action string `json:"action,omitempty"`
|
||||
AddToNav bool `json:"addToNav"`
|
||||
DefaultNav bool `json:"defaultNav"`
|
||||
Slug string `json:"slug"`
|
||||
@@ -103,6 +104,10 @@ func (e Includes) DashboardURLPath() string {
|
||||
return "/d/" + e.UID
|
||||
}
|
||||
|
||||
func (e Includes) RequiresRBACAction() bool {
|
||||
return e.Action != ""
|
||||
}
|
||||
|
||||
type Dependency struct {
|
||||
ID string `json:"id"`
|
||||
Type string `json:"type"`
|
||||
|
||||
Reference in New Issue
Block a user