Fix bug DNN-3698: use UsersPortalId to get correct portal id.
Fix bug DNN-4689: remove the permission if exist and allow access is false.
Fix error in site settings.