role

package
v0.53.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2026 License: Apache-2.0 Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsGlobalScope

func IsGlobalScope(scope Scope) bool

Types

type Action

type Action string
const (
	ReadAction     Action = "read"
	CreateAction   Action = "create"
	UpdateAction   Action = "update"
	DeleteAction   Action = "delete"
	WildcardAction Action = "*"
)

func GetAction

func GetAction(action string) (*Action, error)

GetAction parse string to Action (not case-sensitive)

func (*Action) UnmarshalJSON

func (k *Action) UnmarshalJSON(data []byte) error

func (*Action) UnmarshalYAML

func (k *Action) UnmarshalYAML(unmarshal func(any) error) error

type Permission

type Permission struct {
	// Actions of the permission (read, create, update, delete, ...)
	Actions []Action `json:"actions" yaml:"actions"`
	// The list of kind targeted by the permission. For example: `Datasource`, `Dashboard`, ...
	// With Role, you can't target global kinds
	Scopes []Scope `json:"scopes" yaml:"scopes"`
}

func (*Permission) UnmarshalJSON

func (p *Permission) UnmarshalJSON(data []byte) error

func (*Permission) UnmarshalYAML

func (p *Permission) UnmarshalYAML(unmarshal func(any) error) error

type Scope

type Scope string
const (
	DashboardScope          Scope = "Dashboard"
	DatasourceScope         Scope = "Datasource"
	EphemeralDashboardScope Scope = "EphemeralDashboard"
	FolderScope             Scope = "Folder"
	GlobalDatasourceScope   Scope = "GlobalDatasource"
	GlobalRoleScope         Scope = "GlobalRole"
	GlobalRoleBindingScope  Scope = "GlobalRoleBinding"
	GlobalSecretScope       Scope = "GlobalSecret"
	GlobalVariableScope     Scope = "GlobalVariable"
	ProjectScope            Scope = "Project"
	RoleScope               Scope = "Role"
	RoleBindingScope        Scope = "RoleBinding"
	SecretScope             Scope = "Secret"
	UserScope               Scope = "User"
	VariableScope           Scope = "Variable"
	WildcardScope           Scope = "*"
)

func GetScope

func GetScope(scope string) (*Scope, error)

GetScope parse string to Scope (not case-sensitive)

func (*Scope) UnmarshalJSON

func (k *Scope) UnmarshalJSON(data []byte) error

func (*Scope) UnmarshalYAML

func (k *Scope) UnmarshalYAML(unmarshal func(any) error) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL