`OC_JSON::checkAdminUser();` is your friend.