WordPress install checking permissions of user id 0

The problem turned out to be a form software bbpress interfering in some way with the queries for user permissions. If you find yourself in a similar situation there are a ton of resources on google, some of which may help and some that won’t.

Try uninstalling your plugins (ne-name your plugins folder)
Try re-installing wordpress.
Attempt adding the function in the question to your page, and see if the correct user’s permissions are being requested.