IsReadOnly reports true only for the inspecting subcommands. create/attach/ detach/delete mutate the context store or the session, so they are NOT read-only and (in coder mode) go through the policy confirmation.
(args []string)
| 24 | // detach/delete mutate the context store or the session, so they are NOT |
| 25 | // read-only and (in coder mode) go through the policy confirmation. |
| 26 | func (*BuiltinContextPlugin) IsReadOnly(args []string) bool { |
| 27 | switch cmd, _ := contextSubcommand(args); cmd { |
| 28 | case "list", "status", "show", "inspect", "metrics": |
| 29 | return true |
| 30 | default: |
| 31 | return false |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | // IsConcurrencySafe mirrors IsReadOnly: only the read-only inspections can run |
| 36 | // in parallel with other tools. Mutations are serialized. |