IsAuthCheckDisabled returns true if the command or any ancestor has auth check disabled.
(cmd *cobra.Command)
| 39 | |
| 40 | // IsAuthCheckDisabled returns true if the command or any ancestor has auth check disabled. |
| 41 | func IsAuthCheckDisabled(cmd *cobra.Command) bool { |
| 42 | for c := cmd; c != nil; c = c.Parent() { |
| 43 | if c.Annotations != nil && c.Annotations[skipAuthCheckKey] == "true" { |
| 44 | return true |
| 45 | } |
| 46 | } |
| 47 | return false |
| 48 | } |
no outgoing calls