RBAC: Default to plugins.app:access for plugin includes (#90969)

* Default to app access for includes

* Check plugin type
This commit is contained in:
Gabriel MABILLE
2024-07-29 20:56:09 +02:00
committed by GitHub
parent 34dbfefc86
commit b982259950
6 changed files with 93 additions and 72 deletions

View File

@ -175,6 +175,11 @@ func ReadPluginJSON(reader io.Reader) (JSONData, error) {
if include.Role == "" {
include.Role = org.RoleViewer
}
// Default to app access for app plugins
if plugin.Type == TypeApp && include.Role == org.RoleViewer && include.Action == "" {
include.Action = ActionAppAccess
}
}
return plugin, nil