is this legal?

Not legal in my city in SoCal.
You can't even park in front of any house on the cul-d-sac where I live without a city permit. You can thank the parents of the various sports leagues that use the park across the steet for that. The park is on the backside of an elementary school but the parents don't park in the school parking lot. They fill up all the street and neighborhood parking because it's a few feet closer than the school lot.