ossaccesscontrol

package
v0.0.0-test Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2021 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OSSAccessControlService

type OSSAccessControlService struct {
	Cfg        *setting.Cfg
	UsageStats usagestats.Service
	Log        log.Logger
	// contains filtered or unexported fields
}

OSSAccessControlService is the service implementing role based access control.

func ProvideService

func ProvideService(cfg *setting.Cfg, usageStats usagestats.Service) *OSSAccessControlService

func (*OSSAccessControlService) DeclareFixedRoles

func (ac *OSSAccessControlService) DeclareFixedRoles(registrations ...accesscontrol.RoleRegistration) error

DeclareFixedRoles allow the caller to declare, to the service, fixed roles and their assignments to organization roles ("Viewer", "Editor", "Admin") or "Grafana Admin"

func (*OSSAccessControlService) Evaluate

Evaluate evaluates access to the given resources

func (*OSSAccessControlService) GetUserBuiltInRoles

func (ac *OSSAccessControlService) GetUserBuiltInRoles(user *models.SignedInUser) []string

func (*OSSAccessControlService) GetUserPermissions

func (ac *OSSAccessControlService) GetUserPermissions(ctx context.Context, user *models.SignedInUser) ([]*accesscontrol.Permission, error)

GetUserPermissions returns user permissions based on built-in roles

func (*OSSAccessControlService) GetUserRoles

GetUserRoles returns user permissions based on built-in roles

func (*OSSAccessControlService) IsDisabled

func (ac *OSSAccessControlService) IsDisabled() bool

func (*OSSAccessControlService) RegisterFixedRoles

func (ac *OSSAccessControlService) RegisterFixedRoles() error

RegisterFixedRoles registers all declared roles in RAM

Jump to

Keyboard shortcuts

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