Documentation ¶
Index ¶
- type AccessControl
- type Service
- func (s *Service) DeclareFixedRoles(registrations ...accesscontrol.RoleRegistration) error
- func (s *Service) DeleteUserPermissions(ctx context.Context, orgID int64, userID int64) error
- func (s *Service) GetUsageStats(_ context.Context) map[string]interface{}
- func (s *Service) GetUserPermissions(ctx context.Context, user *user.SignedInUser, options accesscontrol.Options) ([]accesscontrol.Permission, error)
- func (s *Service) IsDisabled() bool
- func (s *Service) RegisterFixedRoles(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessControl ¶
type AccessControl struct {
// contains filtered or unexported fields
}
func ProvideAccessControl ¶
func ProvideAccessControl(cfg *setting.Cfg) *AccessControl
func (*AccessControl) Evaluate ¶
func (a *AccessControl) Evaluate(ctx context.Context, user *user.SignedInUser, evaluator accesscontrol.Evaluator) (bool, error)
func (*AccessControl) IsDisabled ¶
func (a *AccessControl) IsDisabled() bool
func (*AccessControl) RegisterScopeAttributeResolver ¶
func (a *AccessControl) RegisterScopeAttributeResolver(prefix string, resolver accesscontrol.ScopeAttributeResolver)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the service implementing role based access control.
func ProvideOSSService ¶
func ProvideOSSService(cfg *setting.Cfg, store store, cache *localcache.CacheService) *Service
func ProvideService ¶
func ProvideService(cfg *setting.Cfg, store sqlstore.Store, routeRegister routing.RouteRegister, cache *localcache.CacheService) (*Service, error)
func (*Service) DeclareFixedRoles ¶
func (s *Service) 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 (*Service) DeleteUserPermissions ¶
func (*Service) GetUsageStats ¶
func (*Service) GetUserPermissions ¶
func (s *Service) GetUserPermissions(ctx context.Context, user *user.SignedInUser, options accesscontrol.Options) ([]accesscontrol.Permission, error)
GetUserPermissions returns user permissions based on built-in roles
func (*Service) IsDisabled ¶
Click to show internal directories.
Click to hide internal directories.