diff options
author | Chris <ccbrown112@gmail.com> | 2017-06-26 11:33:48 -0700 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2017-06-26 14:33:48 -0400 |
commit | 69ae5cef166501dee49cd3a63d7131323796169e (patch) | |
tree | 9cba33f483cd4bbc7baf6acb4a4a550970209a91 /model/user.go | |
parent | f404483834613fc1250b105461c68145f9543421 (diff) | |
download | chat-69ae5cef166501dee49cd3a63d7131323796169e.tar.gz chat-69ae5cef166501dee49cd3a63d7131323796169e.tar.bz2 chat-69ae5cef166501dee49cd3a63d7131323796169e.zip |
verify for email domain for everything but ldap / saml (#6718)
Diffstat (limited to 'model/user.go')
-rw-r--r-- | model/user.go | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/model/user.go b/model/user.go index 3e71dfeee..970e777fc 100644 --- a/model/user.go +++ b/model/user.go @@ -457,31 +457,25 @@ func IsInRole(userRoles string, inRole string) bool { if r == inRole { return true } - } return false } func (u *User) IsSSOUser() bool { - if u.AuthService != "" && u.AuthService != USER_AUTH_SERVICE_EMAIL { - return true - } - return false + return u.AuthService != "" && u.AuthService != USER_AUTH_SERVICE_EMAIL } func (u *User) IsOAuthUser() bool { - if u.AuthService == USER_AUTH_SERVICE_GITLAB { - return true - } - return false + return u.AuthService == USER_AUTH_SERVICE_GITLAB } func (u *User) IsLDAPUser() bool { - if u.AuthService == USER_AUTH_SERVICE_LDAP { - return true - } - return false + return u.AuthService == USER_AUTH_SERVICE_LDAP +} + +func (u *User) IsSAMLUser() bool { + return u.AuthService == USER_AUTH_SERVICE_SAML } // UserFromJson will decode the input and return a User |