| 343 | } |
| 344 | |
| 345 | func (pm *PolicyManager) defaultRules() { |
| 346 | pm.Rules = []Rule{ |
| 347 | {Pattern: "@coder read", Action: ActionAllow}, |
| 348 | {Pattern: "@coder tree", Action: ActionAllow}, |
| 349 | {Pattern: "@coder search", Action: ActionAllow}, |
| 350 | {Pattern: "@coder git-status", Action: ActionAllow}, |
| 351 | {Pattern: "@coder git-diff", Action: ActionAllow}, |
| 352 | {Pattern: "@coder git-log", Action: ActionAllow}, |
| 353 | {Pattern: "@coder git-changed", Action: ActionAllow}, |
| 354 | {Pattern: "@coder git-branch", Action: ActionAllow}, |
| 355 | // exec always requires per-command approval (never auto-allow) |
| 356 | {Pattern: "@coder exec", Action: ActionAsk}, |
| 357 | } |
| 358 | _ = pm.save() |
| 359 | } |
| 360 | |
| 361 | func findLocalPolicyPath() string { |
| 362 | wd, err := os.Getwd() |