package plugins import ( "github.com/grafana/grafana/pkg/models" ac "github.com/grafana/grafana/pkg/services/accesscontrol" ) const ( ActionAppAccess = "plugins.app:access" ) var ( ScopeProvider = ac.NewScopeProvider("plugins") ) func DeclareRBACRoles(acService ac.AccessControl) error { AppPluginsReader := ac.RoleRegistration{ Role: ac.RoleDTO{ Name: ac.FixedRolePrefix + "plugins.app:reader", DisplayName: "Application Plugins Access", Description: "Access application plugins (still enforcing the organization role)", Group: "Plugins", Permissions: []ac.Permission{ {Action: ActionAppAccess, Scope: ScopeProvider.GetResourceAllScope()}, }, }, Grants: []string{string(models.ROLE_VIEWER)}, } return acService.DeclareFixedRoles(AppPluginsReader) }