MCPcopy Create free account
hub / github.com/compozy/agh / requireCreateAuthority

Function requireCreateAuthority

internal/task/manager.go:2531–2549  ·  view source on GitHub ↗
(actor ActorContext, scope Scope)

Source from the content-addressed store, hash-verified

2529}
2530
2531func requireCreateAuthority(actor ActorContext, scope Scope) error {
2532 if err := requireWriteAuthority(actor); err != nil {
2533 return err
2534 }
2535
2536 switch scope.Normalize() {
2537 case ScopeGlobal:
2538 if !actor.Authority.CreateGlobal {
2539 return ErrPermissionDenied
2540 }
2541 case ScopeWorkspace:
2542 if !actor.Authority.CreateWorkspace {
2543 return ErrPermissionDenied
2544 }
2545 default:
2546 return fmt.Errorf("%w: create_task.scope is required", ErrValidation)
2547 }
2548 return nil
2549}
2550
2551func normalizeCreateTaskSpec(spec CreateTask) (CreateTask, error) {
2552 normalized := spec

Callers 1

CreateTaskMethod · 0.85

Calls 2

requireWriteAuthorityFunction · 0.85
NormalizeMethod · 0.45

Tested by

no test coverage detected