summaryrefslogtreecommitdiffstats
path: root/model/user.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/user.go')
-rw-r--r--model/user.go20
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