func PropertyReadPolicyRule() privacy.QueryRule {
	return privacy.PropertyQueryRuleFunc(func(ctx context.Context, q *ent.PropertyQuery) error {
		var predicates []predicate.Property
		woPredicate := workOrderReadPredicate(ctx)
		if woPredicate != nil {
			predicates = append(predicates,
				property.Or(
					property.Not(property.HasWorkOrder()),
					property.HasWorkOrderWith(woPredicate)))
		}
		projectPredicate := projectReadPredicate(ctx)
		if projectPredicate != nil {
			predicates = append(predicates,
				property.Or(
					property.Not(property.HasProject()),
					property.HasProjectWith(projectPredicate)))
		}
		q.Where(predicates...)
		return privacy.Skip
	})
}
// PropertyReadPolicyRule grants read permission to property based on policy.
PropertyReadPolicyRule grants read permission to property based on policy.
// PropertyReadPolicyRule grants read permission to property based on policy .
func PropertyReadPolicyRule() privacy.QueryRule {
	return privacy.PropertyQueryRuleFunc(func(ctx context.Context, q *ent.PropertyQuery) error {
		var predicates []predicate.Property
		woPredicate := workOrderReadPredicate(ctx)
		if woPredicate != nil {
			predicates = append(predicates,
				property.Or(
					property.Not(property.HasWorkOrder()),
					property.HasWorkOrderWith(woPredicate)))
		}
		projectPredicate := projectReadPredicate(ctx)
		if projectPredicate != nil {
			predicates = append(predicates,
				property.Or(
					property.Not(property.HasProject()),
					property.HasProjectWith(projectPredicate)))
		}
		q.Where(predicates...)
		return privacy.Skip
	})
}
func PropertyReadPolicyRule ( ) privacy . QueryRule { return privacy . PropertyQueryRuleFunc ( func ( ctx context . Context , q * ent . PropertyQuery ) error { var predicates [ ] predicate . Property woPredicate := workOrderReadPredicate ( ctx ) if woPredicate != nil { predicates = append ( predicates , property . Or ( property . Not ( property . HasWorkOrder ( ) ) , property . HasWorkOrderWith ( woPredicate ) ) ) } projectPredicate := projectReadPredicate ( ctx ) if projectPredicate != nil { predicates = append ( predicates , property . Or ( property . Not ( property . HasProject ( ) ) , property . HasProjectWith ( projectPredicate ) ) ) } q . Where ( predicates ... ) return privacy . Skip } ) }
PropertyReadPolicyRule grants read permission to property based on policy.
PropertyReadPolicyRule grants read permission to property based on policy .