The UN does not have the ability to prevent global terrorism. Terrorism is something that will always exist, to some extent at least. There will always be people who get past all security measures that are put in place to prevent terrorism. It is really hard to prevent things such as suicide bombers and the like.
Preventing global terrorism is a virtually impossible task for any one organization, and frankly the UN hasn't shown it's strong enough to be the organization that can change that. They have proven wildly inefficient in bringing problems with violence to a halt in recent years, so taking on such a monumental task is not one that can be left up to them alone. They are, despite not having a great success record lately, still a useful part of the solution, but countries themselves need to work together better for global terrorism to be eradicated.