Revert "Issue #2061977 by InternetDevels, kim.pepper, ianthomas_uk, herom: Replace user_access() calls with ->hasPermission() in all core modules except user."

Fixing commit credit.

This reverts commit 25afa8100ab9a3786594e8fc791c1d76490c42d0.
Issue #2061977 by InternetDevels, kim.pepper, ianthomas_uk, herom, rhm50, naveenvalecha, andypost,  mandar.harkare, sergeypavlenko, sidharthap, SIz, tkuldeep17: Replace user_access() calls with ->hasPermission() in all core modules except user.