func current(c appengine.Context) *User { hdr := c.Request().(http.Header) return &User{ Email: hdr.Get(hEmail), Id: hdr.Get(hId), FederatedIdentity: hdr.Get(hFederatedIdentity), FederatedProvider: hdr.Get(hFederatedProvider), } }
func current(c appengine.Context) *User { hdr := c.Request().(*http.Request).Header return &User{ Email: hdr.Get(hEmail), ID: hdr.Get(hID), Admin: hdr.Get(hIsAdmin) == "1", FederatedIdentity: hdr.Get(hFederatedIdentity), FederatedProvider: hdr.Get(hFederatedProvider), } }
func isAdmin(c appengine.Context) bool { return c.Request().(*http.Request).Header.Get(hIsAdmin) == "1" }