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

			// return on success
			if enforcers != nil {
				return enforcers, nil
			}
		}

		// check second authorizer
		if b.Matcher(ctx) {
			// run callback
			enforcers, err := b.Handler(ctx)
			if err != nil {
				return nil, err
			}

			// return on success
			if enforcers != nil {
				return enforcers, nil
			}
		}

		return nil, nil
	})
}
func Or(a, b *Authorizer) *Authorizer {
	return A("ash/Or", func(ctx *fire.Context) bool {
		return a.Matcher(ctx) || b.Matcher(ctx)
	}, func(ctx *fire.Context) ([]*Enforcer, error) {
		
		if a.Matcher(ctx) {
			
			enforcers, err := a.Handler(ctx)
			if err != nil {
				return nil, err
			}

			
			if enforcers != nil {
				return enforcers, nil
			}
		}

		
		if b.Matcher(ctx) {
			
			enforcers, err := b.Handler(ctx)
			if err != nil {
				return nil, err
			}

			
			if enforcers != nil {
				return enforcers, nil
			}
		}

		return nil, nil
	})
}
func Or ( a , b * Authorizer ) * Authorizer { return A ( " " , func ( ctx * fire . Context ) bool { return a . Matcher ( ctx ) || b . Matcher ( ctx ) } , func ( ctx * fire . Context ) ( [ ] * Enforcer , error ) { // check first authorizer if a . Matcher ( ctx ) { // run callback enforcers , err := a . Handler ( ctx ) if err != nil { return nil , err } // return on success if enforcers != nil { return enforcers , nil } } // check second authorizer if b . Matcher ( ctx ) { // run callback enforcers , err := b . Handler ( ctx ) if err != nil { return nil , err } // return on success if enforcers != nil { return enforcers , nil } } return nil , nil } ) }
// Or will match and run the first authorizer and return its enforcers on success.
// If no enforcers are returned it will match and run the second authorizer and
// return its enforcers.
Or will match and run the first authorizer and return its enforcers on success . If no enforcers are returned it will match and run the second authorizer and return its enforcers .