Exemplo n.º 1
0
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),
	}
}
Exemplo n.º 2
0
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),
	}
}
Exemplo n.º 3
0
func isAdmin(c appengine.Context) bool {
	return c.Request().(*http.Request).Header.Get(hIsAdmin) == "1"
}