diff pkg/models/types.go @ 467:73c7b2d6246e

Used hex-encoded usernames and a stored procedure to decode them to impersonate with the metamorph user.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 22 Aug 2018 17:43:30 +0200
parents fc37e7072022
children 2ac37419f593
line wrap: on
line diff
--- a/pkg/models/types.go	Wed Aug 22 17:30:12 2018 +0200
+++ b/pkg/models/types.go	Wed Aug 22 17:43:30 2018 +0200
@@ -6,8 +6,6 @@
 	"errors"
 	"regexp"
 	"strings"
-
-	"gemma.intevation.de/gemma/pkg/auth"
 )
 
 type (
@@ -82,8 +80,7 @@
 var errNoValidUser = errors.New("Not a valid user")
 
 func (u UserName) IsValid() bool {
-	return u != "" &&
-		!strings.ContainsAny(string(u), auth.InvalidRoleCharacters)
+	return u != ""
 }
 
 func (u *UserName) UnmarshalJSON(data []byte) error {