Files
yatm/internal/executor/location_settings.go
T
Samuel Cui 4fef653b71 Prepare YATM v1.0.0-alpha.2
Unify file queries and Scan execution, retain indexed Identical results,
improve Job and Preview workflows, and verify release packaging.
2026-10-05 19:08:49 +08:00

21 lines
583 B
Go

package executor
import (
"context"
"github.com/samuelncui/yatm/entity"
)
func (e *Executor) AccessSettings(ctx context.Context) (*entity.GetLocationAccessResponse, error) {
// Expose administrator rules without promoting them to editable Location configuration.
reply := &entity.GetLocationAccessResponse{}
for _, access := range e.AccessRanges() {
canonical, err := CanonicalConfiguredPath(access.Root)
if err != nil {
return nil, err
}
reply.Ranges = append(reply.Ranges, &entity.AccessRange{RootPath: canonical, Ignore: access.Ignore})
}
return reply, nil
}