Talking about legality and Indonesian laws, I found this fun to read. It's an intro about the International school issue but it could go with anything really;
[COLOR=#b22222][FONT=Helvetica]In Indonesia, regulations appear to be issued with the sole purpose of creating confusion or making life difficult for well-meaning people and businesses, rather than providing legal clarity and understanding. They are arbitrary at best and harmful at worst.
[/FONT]
[FONT=Helvetica]Because many regulations are born out of the political and financial interests of the ruling elite, the strangest thing happens: those who craft them don’t understand what they have created, and even get confused as to why they have made such regulations, especially after a change of government.
[/FONT]
[FONT=Helvetica]Then, in implementing these regulations, officials have their own interpretations, which vary from one official to another, making it difficult for the society to comply because they see them as being far from serious.[/FONT][/COLOR]
Editorial: Scrap New Rules for International Schools - The Jakarta Globe
My point being, I don't think anyone knows exactly whether riding on the beach is legal and if you'd ask two government officials, policeman or whoever you'll probably end up with two different answers.