// Valid reports whether an identity has valid access for a given route.
Valid reports whether an identity has valid access for a given route.
// Valid reports whether an identity has valid access for a given route .
func (m *identityWhitelist) Valid(route string, i *Identity) bool {
	if ok := m.Domain(route, i.EmailDomain()); ok {
		return ok
	}
	if ok := m.Email(route, i.Email); ok {
		return ok
	}
	for _, group := range i.Groups {
		if ok := m.Group(route, group); ok {
			return ok
		}
	}
	return false
}
func ( m * identityWhitelist ) Valid ( route string , i * Identity ) bool { if ok := m . Domain ( route , i . EmailDomain ( ) ) ; ok { return ok } if ok := m . Email ( route , i . Email ) ; ok { return ok } for _ , group := range i . Groups { if ok := m . Group ( route , group ) ; ok { return ok } } return false }
Valid reports whether an identity has valid access for a given route.
Valid reports whether an identity has valid access for a given route .