rbac

package
v1.12.5 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionAll  Verb = "*"
	ActionView Verb = "view"
	ActionEdit Verb = "edit"

	ScopeAll                          Scope = "*"
	ScopeSettings                     Scope = "settings"
	ScopeUsers                        Scope = "users"
	ScopeRoles                        Scope = "roles"
	ScopeProjectAll                   Scope = "project.*"
	ScopeProjectSettings              Scope = "project.settings"
	ScopeProjectIntegrations          Scope = "project.integrations"
	ScopeProjectApplicationCategories Scope = "project.application_categories"
	ScopeProjectCustomApplications    Scope = "project.custom_applications"
	ScopeProjectCustomCloudPricing    Scope = "project.custom_cloud_pricing"
	ScopeProjectInspections           Scope = "project.inspections"
	ScopeProjectInstrumentations      Scope = "project.instrumentations"
	ScopeProjectTraces                Scope = "project.traces"
	ScopeProjectLogs                  Scope = "project.logs"
	ScopeProjectCosts                 Scope = "project.costs"
	ScopeProjectAnomalies             Scope = "project.anomalies"
	ScopeProjectRisks                 Scope = "project.risks"
	ScopeApplication                  Scope = "project.application"
	ScopeNode                         Scope = "project.node"
	ScopeDashboards                   Scope = "project.dashboards"
	ScopeDashboard                    Scope = "project.dashboard"
)

Variables

Functions

This section is empty.

Types

type Action

type Action struct {
	Scope  Scope
	Action Verb
	Object Object
}

func NewAction

func NewAction(scope Scope, action Verb, object Object) Action

type ActionSet

type ActionSet struct{}
var (
	Actions ActionSet
)

func (ActionSet) List

func (as ActionSet) List() []Action

func (ActionSet) Project

func (as ActionSet) Project(id string) ProjectActionSet

func (ActionSet) Roles

func (as ActionSet) Roles() RolesActionSet

func (ActionSet) Settings added in v1.11.0

func (as ActionSet) Settings() Settings

func (ActionSet) Users

func (as ActionSet) Users() UsersActionSet

type ApplicationActionSet

type ApplicationActionSet struct {
	// contains filtered or unexported fields
}

func (ApplicationActionSet) View

func (as ApplicationActionSet) View() Action

type DashboardActionSet added in v1.12.0

type DashboardActionSet struct {
	// contains filtered or unexported fields
}

func (DashboardActionSet) View added in v1.12.0

func (as DashboardActionSet) View() Action

type NodeActionSet

type NodeActionSet struct {
	// contains filtered or unexported fields
}

func (NodeActionSet) View

func (as NodeActionSet) View() Action

type Object

type Object map[string]string

type Permission

type Permission struct {
	Scope  Scope  `json:"scope"`
	Action Verb   `json:"action"`
	Object Object `json:"object"`
}

func NewPermission

func NewPermission(scope Scope, action Verb, object Object) Permission

type PermissionSet

type PermissionSet []Permission

func (PermissionSet) Allows

func (ps PermissionSet) Allows(action Action) bool

func (PermissionSet) AllowsForObjects

func (ps PermissionSet) AllowsForObjects(action Action) []Object

type ProjectAction added in v1.8.0

type ProjectAction struct {
	// contains filtered or unexported fields
}

func (ProjectAction) Edit added in v1.8.0

func (as ProjectAction) Edit() Action

func (ProjectAction) View added in v1.8.0

func (as ProjectAction) View() Action

type ProjectActionSet

type ProjectActionSet struct {
	// contains filtered or unexported fields
}

func (ProjectActionSet) Anomalies added in v1.8.6

func (as ProjectActionSet) Anomalies() ProjectViewAction

func (ProjectActionSet) Application

func (as ProjectActionSet) Application(category model.ApplicationCategory, namespace string, kind model.ApplicationKind, name string) ApplicationActionSet

func (ProjectActionSet) ApplicationCategories

func (as ProjectActionSet) ApplicationCategories() ProjectEditAction

func (ProjectActionSet) Costs

func (ProjectActionSet) CustomApplications

func (as ProjectActionSet) CustomApplications() ProjectEditAction

func (ProjectActionSet) CustomCloudPricing added in v1.11.0

func (as ProjectActionSet) CustomCloudPricing() ProjectEditAction

func (ProjectActionSet) Dashboard added in v1.12.0

func (as ProjectActionSet) Dashboard(name string) DashboardActionSet

func (ProjectActionSet) Dashboards added in v1.12.0

func (as ProjectActionSet) Dashboards() ProjectEditAction

func (ProjectActionSet) Inspections

func (as ProjectActionSet) Inspections() ProjectEditAction

func (ProjectActionSet) Instrumentations

func (as ProjectActionSet) Instrumentations() ProjectEditAction

func (ProjectActionSet) Integrations

func (as ProjectActionSet) Integrations() ProjectEditAction

func (ProjectActionSet) List added in v1.8.6

func (as ProjectActionSet) List() []Action

func (ProjectActionSet) Logs added in v1.11.3

func (ProjectActionSet) Node

func (as ProjectActionSet) Node(name string) NodeActionSet

func (ProjectActionSet) Risks added in v1.8.0

func (as ProjectActionSet) Risks() ProjectAction

func (ProjectActionSet) Settings

func (as ProjectActionSet) Settings() ProjectEditAction

func (ProjectActionSet) Traces

func (as ProjectActionSet) Traces() ProjectViewAction

type ProjectEditAction

type ProjectEditAction struct {
	// contains filtered or unexported fields
}

func (ProjectEditAction) Edit

func (as ProjectEditAction) Edit() Action

type ProjectViewAction

type ProjectViewAction struct {
	// contains filtered or unexported fields
}

func (ProjectViewAction) View

func (as ProjectViewAction) View() Action

type Role

type Role struct {
	Name        RoleName      `json:"name"`
	Permissions PermissionSet `json:"permissions"`
}

func NewRole

func NewRole(name RoleName, permissions ...Permission) Role

type RoleManager

type RoleManager interface {
	GetRoles() ([]Role, error)
}

type RoleName

type RoleName string
const (
	RoleAdmin  RoleName = "Admin"
	RoleEditor RoleName = "Editor"
	RoleViewer RoleName = "Viewer"
)

func (RoleName) Builtin

func (r RoleName) Builtin() bool

func (RoleName) Valid

func (r RoleName) Valid(roles []Role) bool

type RolesActionSet

type RolesActionSet struct{}

func (RolesActionSet) Edit

func (as RolesActionSet) Edit() Action

type Scope

type Scope string

type Settings added in v1.11.0

type Settings struct{}

func (Settings) Edit added in v1.11.0

func (as Settings) Edit() Action

type StaticRoleManager

type StaticRoleManager struct{}

func NewStaticRoleManager

func NewStaticRoleManager() *StaticRoleManager

func (*StaticRoleManager) GetRoles

func (mgr *StaticRoleManager) GetRoles() ([]Role, error)

type UsersActionSet

type UsersActionSet struct{}

func (UsersActionSet) Edit

func (as UsersActionSet) Edit() Action

type Verb

type Verb string

Jump to

Keyboard shortcuts

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