MDL-44070 Conditional availability enhancements (?): core access

Changes core code to use new API instead of the old one when
checking user access to activities and sections.