diff --git a/orm/contest.go b/orm/contest.go index 8687f120..cf23ed48 100644 --- a/orm/contest.go +++ b/orm/contest.go @@ -125,6 +125,8 @@ func (c *Contest) Read(db *Database, args map[string]string, w http.ResponseWrit func (c *Contest) ReadAll(db *Database, args map[string]string, w http.ResponseWriter, r *http.Request) (interface{}, error) { var contests []*Contest + log.Println(r.Header) + claims := r.Context().Value("user").(*jwt.Token).Claims.(jwt.MapClaims) if claims["admin"].(bool) { diff --git a/orm/usermodifier.go b/orm/usermodifier.go index 2af014c3..c72775f3 100644 --- a/orm/usermodifier.go +++ b/orm/usermodifier.go @@ -54,7 +54,6 @@ func WriteCreator(r *http.Request, modifier Modifier) { modifier.SetCreatorID(getUserIDFromTokenAsUint(r)) modifier.SetCreatorRole(getUserRole(r)) modifier.SetCreatorIP(r.RemoteAddr) - } func WriteUpdater(r *http.Request, modifier Modifier) {