ash/authorizer.go
func And(a, b *Authorizer) *Authorizer {
	return A("ash/And", func(ctx *fire.Context) bool {
		return a.Matcher(ctx) && b.Matcher(ctx)
	}, func(ctx *fire.Context) ([]*Enforcer, error) {
		// run first callback
		enforcers1, err := a.Handler(ctx)
		if err != nil {
			return nil, err
		} else if enforcers1 == nil {
			return nil, nil
		}

		// run second callback
		enforcers2, err := b.Handler(ctx)
		if err != nil {
			return nil, err
		} else if enforcers2 == nil {
			return nil, nil
		}

		// merge both sets
		enforcers := append(S{}, enforcers1...)
		enforcers = append(enforcers, enforcers2...)

		return enforcers, nil
	})
}
func And(a, b *Authorizer) *Authorizer {
	return A("ash/And", func(ctx *fire.Context) bool {
		return a.Matcher(ctx) && b.Matcher(ctx)
	}, func(ctx *fire.Context) ([]*Enforcer, error) {
		// run first callback
		enforcers1, err := a.Handler(ctx)
		if err != nil {
			return nil, err
		} else if enforcers1 == nil {
			return nil, nil
		}

		// run second callback
		enforcers2, err := b.Handler(ctx)
		if err != nil {
			return nil, err
		} else if enforcers2 == nil {
			return nil, nil
		}

		// merge both sets
		enforcers := append(S{}, enforcers1...)
		enforcers = append(enforcers, enforcers2...)

		return enforcers, nil
	})
}
// And will match and run both authorizers and return immediately if one does not
// return a set of enforcers. The two successfully returned enforcer sets are
// merged into one and returned.