Documentation
¶
Index ¶
- Constants
- Variables
- type Action
- type ActionSet
- type ApplicationActionSet
- type NodeActionSet
- type Object
- type Permission
- type PermissionSet
- type ProjectActionSet
- func (as ProjectActionSet) Application(category model.ApplicationCategory, namespace string, ...) ApplicationActionSet
- func (as ProjectActionSet) ApplicationCategories() ProjectEditAction
- func (as ProjectActionSet) Costs() ProjectViewAction
- func (as ProjectActionSet) CustomApplications() ProjectEditAction
- func (as ProjectActionSet) Inspections() ProjectEditAction
- func (as ProjectActionSet) Instrumentations() ProjectEditAction
- func (as ProjectActionSet) Integrations() ProjectEditAction
- func (as ProjectActionSet) Node(name string) NodeActionSet
- func (as ProjectActionSet) Settings() ProjectEditAction
- func (as ProjectActionSet) Traces() ProjectViewAction
- type ProjectEditAction
- type ProjectViewAction
- type Role
- type RoleManager
- type RoleName
- type RolesActionSet
- type Scope
- type StaticRoleManager
- type UsersActionSet
- type Verb
Constants ¶
View Source
const ( ActionAll Verb = "*" ActionView Verb = "view" ActionEdit Verb = "edit" ScopeAll Scope = "*" 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" ScopeProjectInspections Scope = "project.inspections" ScopeProjectInstrumentations Scope = "project.instrumentations" ScopeProjectTraces Scope = "project.traces" ScopeProjectCosts Scope = "project.costs" ScopeApplication Scope = "project.application" ScopeNode Scope = "project.node" )
Variables ¶
View Source
var ( Roles = []Role{ NewRole(RoleAdmin, NewPermission(ScopeAll, ActionAll, nil), ), NewRole(RoleEditor, NewPermission(ScopeAll, ActionView, nil), NewPermission(ScopeProjectApplicationCategories, ActionEdit, nil), NewPermission(ScopeProjectCustomApplications, ActionEdit, nil), NewPermission(ScopeProjectInspections, ActionEdit, nil), ), NewRole(RoleViewer, NewPermission(ScopeAll, ActionView, nil), ), } )
Functions ¶
This section is empty.
Types ¶
type ActionSet ¶
type ActionSet struct{}
var (
Actions ActionSet
)
func (ActionSet) Project ¶
func (as ActionSet) Project(id string) ProjectActionSet
func (ActionSet) Roles ¶
func (as ActionSet) Roles() RolesActionSet
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 NodeActionSet ¶
type NodeActionSet struct {
// contains filtered or unexported fields
}
func (NodeActionSet) View ¶
func (as NodeActionSet) View() Action
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 ProjectActionSet ¶
type ProjectActionSet struct {
// contains filtered or unexported fields
}
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 (as ProjectActionSet) Costs() ProjectViewAction
func (ProjectActionSet) CustomApplications ¶
func (as ProjectActionSet) CustomApplications() 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) Node ¶
func (as ProjectActionSet) Node(name string) NodeActionSet
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 RolesActionSet ¶
type RolesActionSet struct{}
func (RolesActionSet) Edit ¶
func (as RolesActionSet) 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
Click to show internal directories.
Click to hide internal directories.