Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PolicyManager ¶
type PolicyManager struct {
// contains filtered or unexported fields
}
PolicyManager evaluates per-tool permission policies.
func LoadPolicies ¶
func LoadPolicies(workDir string) (*PolicyManager, error)
LoadPolicies builds a PolicyManager by reading permissions YAML files. It checks the repo-level file (.polycode/permissions.yaml in workDir) first, then the user-level file (~/.config/polycode/permissions.yaml). Repo-level policies take precedence over user-level policies.
func (*PolicyManager) Check ¶
func (p *PolicyManager) Check(toolName string) Policy
Check returns the policy for the given tool name. Evaluation order:
- Exact match in the policies map.
- Glob/pattern match (entries containing "*").
- Default: PolicyAsk.
Click to show internal directories.
Click to hide internal directories.