* Move database-related models to enterprise * Chore: use GetUserBuiltInRoles() method * Rename permission to action
19 lines
529 B
Go
19 lines
529 B
Go
package accesscontrol
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/grafana/grafana/pkg/models"
|
|
)
|
|
|
|
type AccessControl interface {
|
|
// Evaluate evaluates access to the given resource.
|
|
Evaluate(ctx context.Context, user *models.SignedInUser, permission string, scope ...string) (bool, error)
|
|
|
|
// GetUserPermissions returns user permissions.
|
|
GetUserPermissions(ctx context.Context, user *models.SignedInUser) ([]*Permission, error)
|
|
|
|
// Middleware checks if service disabled or not to switch to fallback authorization.
|
|
IsDisabled() bool
|
|
}
|