Issue #2302463 by effulgentsia: Cleanup User::hasPermission() and UserSession::hasPermission() to follow Law of Demeter.