oficina / equipo Public

Clone
git clone https://amadan.net/oficina/equipo

Plain git — no account needed to clone.

Download

Download this file

1package equipo
2
3import (
4 "amadan.net/oficina/equipo/internal/equipo/library"
5 "gorm.io/gorm"
6)
7
8type SpecialistInput = library.SpecialistInput
9type ModelRef = library.ModelRef
10type TemplateRef = library.TemplateRef
11type TemplateDiff = library.TemplateDiff
12type PlaybookInput = library.PlaybookInput
13type Playbook = library.Playbook
14
15func (s *Store) libraryAt(tx *gorm.DB) *library.Store {
16 return library.New(tx, library.Dependencies{
17 Authorize: func(tx *gorm.DB, a Actor) (library.Access, error) {
18 m, err := currentRunnerMember(tx, a.Address)
19 if err != nil {
20 return library.Access{}, err
21 }
22 var t Team
23 err = tx.First(&t).Error
24 return library.Access{TeamID: t.ID, Owner: m.Role == RoleOwner}, err
25 },
26 TaskAccess: func(tx *gorm.DB, a Actor, id int64) error { _, err := bugAuthority(tx, a, id); return err },
27 Audit: appendAudit, Copy: copyText, Catalog: library.Catalog,
28
29 Referenced: library.UnstartedReference,
30 Invalid: ErrInvalid, Forbidden: ErrForbidden, NotFound: ErrNotFound, Conflict: ErrConflict,
31 })
32}
33