weblib: build_navigation() try to avoid pointless capchecks
weblib: build_navigation() try to avoid pointless capchecks

Prevent calls to has_capability() in build_navigation() from messing
with upgrades.

Most calls to has_capability() in weblib should be moved to the callers.

dilawar/moodle