admin

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrLastAdmin = errors.New("cannot demote the last admin")

ErrLastAdmin is returned when trying to demote the only remaining admin.

View Source
var ErrSystemEntityImmutable = errors.New("entity is system-tagged and cannot be modified from the admin UI")

ErrSystemEntityImmutable is returned when an admin tries to mutate (disable/hide/retag) a tool/job/connector that carries any System tag. System-tagged entities are owned by code — see entity.Tag godoc.

View Source
var ErrSystemTagAssignment = errors.New("system tags cannot be assigned to users")

ErrSystemTagAssignment is returned when an admin tries to attach a tag flagged IsSystem to a user. System tags are code-owned and exist solely to gate built-in maintenance items behind a tag no end user can carry — see entity.Tag godoc.

View Source
var ErrSystemTagImmutable = errors.New("system tags are read-only and cannot be modified")

ErrSystemTagImmutable is returned when an admin tries to edit, delete, or otherwise mutate a Tag whose IsSystem flag is true. System tags are owned by code (seeded via tool/job DefaultTags) and changing them from the UI would desync the seed catalog from the DB.

View Source
var ErrTagNameTaken = errors.New("a tag with that name already exists")

ErrTagNameTaken is returned when creating or renaming a tag to an existing name.

View Source
var ErrUserNotApproved = errors.New("user must be approved before assigning tags")

ErrUserNotApproved is returned when trying to assign tags to an unapproved user.

View Source
var StaticFS embed.FS

Functions

This section is empty.

Types

type Handler

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

func NewHandler

func NewHandler(
	db *gorm.DB,
	tools []tool.Tool,
	configsSvc *configs.Service,
	ssoSvc *sso.Service,
	svc JobListProvider,
	connectorsSvc *connectors.Service,
	tokensSvc *accesstoken.Service,
	oauthSvc *oauth.Service,
) *Handler

func (*Handler) Register

func (h *Handler) Register(mux *http.ServeMux, sessionMidd *login.Middleware)

type JobListProvider

type JobListProvider interface {
	ListJobs(ctx context.Context) ([]entity.Job, error)
}

JobListProvider is the subset of manager.Service that the admin panel needs.

type ToolPerm

type ToolPerm struct {
	Path       string
	Visibility entity.ToolVisibility
	Disabled   bool
	TagIDs     []string
}

Directories

Path Synopsis
templ: version: v0.3.1020
templ: version: v0.3.1020

Jump to

Keyboard shortcuts

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