Thank you for your question. I will try to assist you in answering it today but please feel free to ask as many follow up questions as you like until you are 100% satisfied.
Yes, you can certainly apply for a Court Order that the City of Cape Town either keeps the gates closed or ensures that the vagrants are permanently removed from the property. The problem with closing the gates, is that the forest may be considered as property belonging to the public, in which case the Court will not grant an interdict to restrict access - however, if it is private property, such an application should not pose a problem.
On the other hand, even if it is considered public property (like the beach for instance) to which everyone has unrestricted access, such access and use and enjoyment can only be allowed if it does not interfere with the rights of others. So, as an example, access to a beach (public property) may not be restricted, BUT it can, and must be controlled. In other words, although all people have the right of access to the beach, it does not mean they can go and do on the beach whatever they wish. One is not allowed to camp (live) on the beach, the use of alcohol on a beach is prohibited and the authorities can remove you from the beach if you do not obey these rules/laws.
The same would apply to this property (forest). Causing a nuisance and making a noise is an offense and the SAPS and/or Cape Town Metro Police must act to stop that from happening. So, depending on the property, the gates should be closed and controlled to restrict access only for certain purposes and for certain times of the day.
In George for instance, the access to the Garden Route dam is restricted and controlled by a gate.
I hope this answered your question.
I know it will take an extra minute of your time to rate my service, but if you do not rate it, I do not get paid by the website so I would really appreciate it if you would be so kind as to rate my service positively. Feel free to ask further question here on this topic at no extra cost if you need more information.