authorize validates user right to execute commands
(user string)
| 115 | |
| 116 | // authorize validates user right to execute commands |
| 117 | func authorizeUser(user string) (err error) { |
| 118 | // As we use terminal like proxy, then |
| 119 | // we will intercept user name to validate if it's allowed to execute commands |
| 120 | if user != "gopher" { |
| 121 | // Do some logs, notifications etc... |
| 122 | err = fmt.Errorf("User %s in black list", user) |
| 123 | return |
| 124 | } |
| 125 | |
| 126 | return |
| 127 | } |