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:
co-authored by
ievaVasiljeva
parent
bce83485a9
commit
a8c48b6801
@@ -88,6 +88,9 @@ seqs: [
|
||||
component?: string
|
||||
role?: "Admin" | "Editor" | "Viewer"
|
||||
|
||||
// RBAC action the user must have to access the route
|
||||
action?: string
|
||||
|
||||
// Used for app plugins.
|
||||
path?: string
|
||||
|
||||
@@ -163,7 +166,7 @@ seqs: [
|
||||
permissions: [...#Permission]
|
||||
}
|
||||
|
||||
// Permission describes an RBAC permission on the plugin. A permission has an action and an option
|
||||
// Permission describes an RBAC permission on the plugin. A permission has an action and an optional
|
||||
// scope.
|
||||
// Example: action: 'test-app.schedules:read', scope: 'test-app.schedules:*'
|
||||
#Permission: {
|
||||
|
||||
@@ -362,6 +362,9 @@ type Header struct {
|
||||
|
||||
// A resource to be included in a plugin.
|
||||
type Include struct {
|
||||
// RBAC action the user must have to access the route
|
||||
Action *string `json:"action,omitempty"`
|
||||
|
||||
// Add the include to the side menu.
|
||||
AddToNav *bool `json:"addToNav,omitempty"`
|
||||
|
||||
@@ -462,7 +465,7 @@ type JWTTokenAuth struct {
|
||||
Url string `json:"url"`
|
||||
}
|
||||
|
||||
// Permission describes an RBAC permission on the plugin. A permission has an action and an option
|
||||
// Permission describes an RBAC permission on the plugin. A permission has an action and an optional
|
||||
// scope.
|
||||
// Example: action: 'test-app.schedules:read', scope: 'test-app.schedules:*'
|
||||
type Permission struct {
|
||||
|
||||
Reference in New Issue
Block a user