func (u *Union) Check(permission Permission) bool {
	return u.P1.Check(permission) || u.P2.Check(permission)
}
Check performs the underlying policy check for each policy, returning true if either
policy.Check call returns true
package policy
import (
	"fmt"
	"reflect"
	recoveryConsts "github.com/theparanoids/ashirt-server/backend/authschemes/recoveryauth/constants"
)
type Policy interface {
	Check(Permission) bool
	String() string
}
func Require(policy Policy, requiredPermissions ...Permission) error {
	for _, permission := range requiredPermissions {
		if !policy.Check(permission) {
			return fmt.Errorf("%s failed permission check %s%v", policy.String(), reflect.TypeOf(permission), permission)
		}
	}
	return nil
}
type Deny struct{}
func (*Deny) String() string { return "DenyPolicy" }
func (*Deny) Check(Permission) bool { return false }
type FullAccess struct{}
func (*FullAccess) String() string { return "FullAccessPolicy" }
func (*FullAccess) Check(Permission) bool { return true }
type Union struct {
	P1 Policy
	P2 Policy
}
func (u *Union) String() string { return fmt.Sprintf("%s|%s", u.P1.String(), u.P2.String()) }