def METHOD_NAME(
	df, doctype_user_permissions, allowed_records, user_default=None
):
	is_valid = True
	# If User Permission exists and allowed records is empty,
	# that means there are User Perms, but none applicable to this new doctype.
	if user_permissions_exist(df, doctype_user_permissions) and allowed_records:
		# If allowed records is not empty,
		# check if this field value is allowed via User Permissions applied to this doctype.
		value = user_default if user_default else df.default
		is_valid = value in allowed_records
	return is_valid