AccessControl: Make the built-in role definitions public (#47525)
* AccessControl: Make the built-in role definitions public * Add context to RegisterFixedRoles Co-authored-by: Jguer <joao.guerreiro@grafana.com> * Making BuiltInRolesWithParents public to the AccessControl package Co-authored-by: Jguer <joao.guerreiro@grafana.com> Co-authored-by: Jguer <joao.guerreiro@grafana.com>
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
type fullAccessControl interface {
|
||||
accesscontrol.AccessControl
|
||||
GetUserBuiltInRoles(user *models.SignedInUser) []string
|
||||
RegisterFixedRoles() error
|
||||
RegisterFixedRoles(context.Context) error
|
||||
}
|
||||
|
||||
type Calls struct {
|
||||
@@ -165,7 +165,7 @@ func (m *Mock) GetUserBuiltInRoles(user *models.SignedInUser) []string {
|
||||
|
||||
// RegisterFixedRoles registers all roles declared to AccessControl
|
||||
// This mock returns no error unless an override is provided.
|
||||
func (m *Mock) RegisterFixedRoles() error {
|
||||
func (m *Mock) RegisterFixedRoles(ctx context.Context) error {
|
||||
m.Calls.RegisterFixedRoles = append(m.Calls.RegisterFixedRoles, []struct{}{})
|
||||
// Use override if provided
|
||||
if m.RegisterFixedRolesFunc != nil {
|
||||
|
||||
Reference in New Issue
Block a user