func PropertyTypeCreatePolicyRule() privacy.MutationRule {
	return privacy.PropertyTypeMutationRuleFunc(func(ctx context.Context, m *ent.PropertyTypeMutation) error {
		if !m.Op().Is(ent.OpCreate) {
			return privacy.Skip
		}
		p := FromContext(ctx)
		if _, exists := m.LocationTypeID(); exists {
			return allowOrSkip(p.InventoryPolicy.LocationType.Update)
		}
		if _, exists := m.EquipmentTypeID(); exists {
			return allowOrSkip(p.InventoryPolicy.EquipmentType.Update)
		}
		if _, exists := m.EquipmentPortTypeID(); exists {
			return allowOrSkip(p.InventoryPolicy.PortType.Update)
		}
		if _, exists := m.LinkEquipmentPortTypeID(); exists {
			return allowOrSkip(p.InventoryPolicy.LocationType.Update)
		}
		if _, exists := m.ServiceTypeID(); exists {
			return allowOrSkip(p.InventoryPolicy.ServiceType.Update)
		}
		if _, exists := m.WorkOrderTypeID(); exists {
			return allowOrSkip(p.WorkforcePolicy.Templates.Update)
		}
		if _, exists := m.WorkOrderTemplateID(); exists {
			return allowOrSkip(p.WorkforcePolicy.Templates.Update)
		}
		if _, exists := m.ProjectTypeID(); exists {
			return allowOrSkip(p.WorkforcePolicy.Templates.Update)
		}
		return privacy.Skip
	})
}
// PropertyTypeCreatePolicyRule grants create permission to property type based on policy.
// nolint: dupl
PropertyTypeCreatePolicyRule grants create permission to property type based on policy.
nolint: dupl
// PropertyTypeCreatePolicyRule grants create permission to property type based on policy . // nolint : dupl
func PropertyTypeCreatePolicyRule() privacy.MutationRule {
	return privacy.PropertyTypeMutationRuleFunc(func(ctx context.Context, m *ent.PropertyTypeMutation) error {
		if !m.Op().Is(ent.OpCreate) {
			return privacy.Skip
		}
		p := FromContext(ctx)
		if _, exists := m.LocationTypeID(); exists {
			return allowOrSkip(p.InventoryPolicy.LocationType.Update)
		}
		if _, exists := m.EquipmentTypeID(); exists {
			return allowOrSkip(p.InventoryPolicy.EquipmentType.Update)
		}
		if _, exists := m.EquipmentPortTypeID(); exists {
			return allowOrSkip(p.InventoryPolicy.PortType.Update)
		}
		if _, exists := m.LinkEquipmentPortTypeID(); exists {
			return allowOrSkip(p.InventoryPolicy.LocationType.Update)
		}
		if _, exists := m.ServiceTypeID(); exists {
			return allowOrSkip(p.InventoryPolicy.ServiceType.Update)
		}
		if _, exists := m.WorkOrderTypeID(); exists {
			return allowOrSkip(p.WorkforcePolicy.Templates.Update)
		}
		if _, exists := m.WorkOrderTemplateID(); exists {
			return allowOrSkip(p.WorkforcePolicy.Templates.Update)
		}
		if _, exists := m.ProjectTypeID(); exists {
			return allowOrSkip(p.WorkforcePolicy.Templates.Update)
		}
		return privacy.Skip
	})
}
func PropertyTypeCreatePolicyRule ( ) privacy . MutationRule { return privacy . PropertyTypeMutationRuleFunc ( func ( ctx context . Context , m * ent . PropertyTypeMutation ) error { if ! m . Op ( ) . Is ( ent . OpCreate ) { return privacy . Skip } p := FromContext ( ctx ) if _ , exists := m . LocationTypeID ( ) ; exists { return allowOrSkip ( p . InventoryPolicy . LocationType . Update ) } if _ , exists := m . EquipmentTypeID ( ) ; exists { return allowOrSkip ( p . InventoryPolicy . EquipmentType . Update ) } if _ , exists := m . EquipmentPortTypeID ( ) ; exists { return allowOrSkip ( p . InventoryPolicy . PortType . Update ) } if _ , exists := m . LinkEquipmentPortTypeID ( ) ; exists { return allowOrSkip ( p . InventoryPolicy . LocationType . Update ) } if _ , exists := m . ServiceTypeID ( ) ; exists { return allowOrSkip ( p . InventoryPolicy . ServiceType . Update ) } if _ , exists := m . WorkOrderTypeID ( ) ; exists { return allowOrSkip ( p . WorkforcePolicy . Templates . Update ) } if _ , exists := m . WorkOrderTemplateID ( ) ; exists { return allowOrSkip ( p . WorkforcePolicy . Templates . Update ) } if _ , exists := m . ProjectTypeID ( ) ; exists { return allowOrSkip ( p . WorkforcePolicy . Templates . Update ) } return privacy . Skip } ) }
PropertyTypeCreatePolicyRule grants create permission to property type based on policy.
PropertyTypeCreatePolicyRule grants create permission to property type based on policy .