Allow connecting to the shell mode with the registered username or email

This commit is contained in:
Manfred Touron 2017-11-23 17:23:20 +01:00
parent 9cd9152a91
commit a36bb68957
2 changed files with 2 additions and 1 deletions

View file

@ -6,6 +6,7 @@
* Add 'host update' command (fix [#2](https://github.com/moul/sshportal/issues/2))
* Add 'user update' command (fix [#3](https://github.com/moul/sshportal/issues/3))
* Add 'acl update' command (fix [#4](https://github.com/moul/sshportal/issues/4))
* Allow connecting to the shell mode with the registered username or email
## v1.2.0 (2017-11-22)

View file

@ -119,7 +119,7 @@ func server(c *cli.Context) error {
}
switch username := s.User(); {
case username == c.String("config-user"):
case username == currentUser.Name || username == currentUser.Email || username == c.String("config-user"):
if !UserHasRole(currentUser, "admin") {
fmt.Fprintf(s, "You are not an administrator, permission denied.\n")
return