Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrReadForbidden = errutil.NewBase( errutil.StatusForbidden, "annotations.accesscontrol.read", errutil.WithPublicMessage("User missing permissions"), ) ErrAccessControlInternal = errutil.NewBase( errutil.StatusInternal, "annotations.accesscontrol.internal", errutil.WithPublicMessage("Internal error while checking permissions"), ) )
Functions ¶
This section is empty.
Types ¶
type AccessResources ¶
type AccessResources struct { // Dashboards is a map of dashboard UIDs to IDs Dashboards map[string]int64 // CanAccessDashAnnotations true if the user is allowed to access some dashboard annotations CanAccessDashAnnotations bool // CanAccessOrgAnnotations true if the user is allowed to access organization annotations CanAccessOrgAnnotations bool }
AccessResources contains resources that are used to filter annotations based on RBAC.
type AuthService ¶
type AuthService struct {
// contains filtered or unexported fields
}
func NewAuthService ¶
func NewAuthService(db db.DB, features featuremgmt.FeatureToggles) *AuthService
func (*AuthService) Authorize ¶
func (authz *AuthService) Authorize(ctx context.Context, orgID int64, query *annotations.ItemQuery) (*AccessResources, error)
Authorize checks if the user has permission to read annotations, then returns a struct containing dashboards and scope types that the user has access to.
Click to show internal directories.
Click to hide internal directories.