Users can’t view a page just after being added to a group that grants permission to view the page

Permalink 0 0 Browser Info Environment
I have some code added to a block on a page that automatically adds a user to a specific group:

$g = Group::getByID(5);
$u = new User();
$u->enterGroup($g);


But after the user is added to the group, which I verified through the Dashboard, the page which the group grants permission to view remains unavailable for view in the NAV by the user.

I found several references to using this code:

$u->refreshUserGroups();


The code for the refreshUserGroups() function is in:https://documentation.concrete5.org/api/8.5.2/Concrete/Core/User/Use... refreshUserGroups() at line 563

But this has no immediate effect on the page showing up in the NAV.

The only thing that does work, with or without calling refreshUserGroups(), is logging out and then logging back in. Then the page shows up on the NAV and the same user can now view the page.

Having to logout and re-login is very user unfriendly. I am hoping to find a solution or, if this is a bug, I am hoping that it be fixed.


Status: New
jfhencken

concrete5 Environment Information

# concrete5 Version
Core Version - 8.5.2
Version Installed - 8.5.2
Database Version - 20190925072210

# Database Information
Version: 5.6.45
SQL Mode: NO_ENGINE_SUBSTITUTION

# concrete5 Packages
Automatic Email Obfuscator (2.0.1), Background Image and Overlay (0.9.9), Customize Editing Interface (1.0.1), Dex Superfish (2.1.0), Free Google Maps (1.0.0), Hidden Data Attributes for Express (1.0.1), Honest Websites Back To Top (1.1.0), HTML+PHP Code Block (1.0.2), Login/Logout Link (1.0), Login Page Background (0.9.1), PDF Viewer (1.0.1), Vimeo Video (1.0.2)

# concrete5 Overrides
elements/footer_required.php, themes/clonelemental/right_sidebar.php, themes/clonelemental/blank.php, themes/clonelemental/view.php, themes/clonelemental/page_theme.php, themes/clonelemental/images/background.png, themes/clonelemental/images/background-slider-default.png, themes/clonelemental/images/background-slider-blue-sky.png, themes/clonelemental/images/background-slider-royal.png, themes/clonelemental/images/background-slider-night-road.png, themes/clonelemental/images, themes/clonelemental/thumbnail.png, themes/clonelemental/left_sidebar.php, themes/clonelemental/full.php, themes/clonelemental/page_forbidden.php, themes/clonelemental/elements/footer.php, themes/clonelemental/elements/header.php, themes/clonelemental/elements/footer_bottom.php, themes/clonelemental/elements/header_top.php, themes/clonelemental/elements/header_ORIG.php, themes/clonelemental/elements, themes/clonelemental/page_not_found.php, themes/clonelemental/default.php, themes/clonelemental/css/bootstrap-modified.css, themes/clonelemental/css/main.less, themes/clonelemental/css/build/header.less, themes/clonelemental/css/build/fonts/night-road.less, themes/clonelemental/css/build/fonts/defaults.less, themes/clonelemental/css/build/fonts/royal.less, themes/clonelemental/css/build/fonts/blue-sky.less, themes/clonelemental/css/build/fonts, themes/clonelemental/css/build/mobile/navigation.less, themes/clonelemental/css/build/mobile, themes/clonelemental/css/build/body.less, themes/clonelemental/css/build/reset.less, themes/clonelemental/css/build/bootstrap-3.2.0/alerts.less, themes/clonelemental/css/build/bootstrap-3.2.0/mixins/border-radius.less, themes/clonelemental/css/build/bootstrap-3.2.0/mixins/gradients.less, themes/clonelemental/css/build/bootstrap-3.2.0/mixins/resize.less, themes/clonelemental/css/build/bootstrap-3.2.0/mixins/alerts.less, themes/clonelemental/css/build/bootstrap-3.2.0/mixins/progress-bar.less, themes/clonelemental/css/build/bootstrap-3.2.0/mixins/nav-divider.less, themes/clonelemental/css/build/bootstrap-3.2.0/mixins/tab-focus.less, themes/clonelemental/css/build/bootstrap-3.2.0/mixins/image.less, themes/clonelemental/css/build/bootstrap-3.2.0/mixins/hide-text.less, themes/clonelemental/css/build/bootstrap-3.2.0/mixins/list-group.less, themes/clonelemental/css/build/bootstrap-3.2.0/mixins/labels.less, themes/clonelemental/css/build/bootstrap-3.2.0/mixins/forms.less, themes/clonelemental/css/build/bootstrap-3.2.0/mixins/text-emphasis.less, themes/clonelemental/css/build/bootstrap-3.2.0/mixins/size.less, themes/clonelemental/css/build/bootstrap-3.2.0/mixins/grid.less, themes/clonelemental/css/build/bootstrap-3.2.0/mixins/responsive-visibility.less, themes/clonelemental/css/build/bootstrap-3.2.0/mixins/panels.less, themes/clonelemental/css/build/bootstrap-3.2.0/mixins/center-block.less, themes/clonelemental/css/build/bootstrap-3.2.0/mixins/text-overflow.less, themes/clonelemental/css/build/bootstrap-3.2.0/mixins/grid-framework.less, themes/clonelemental/css/build/bootstrap-3.2.0/mixins/buttons.less, themes/clonelemental/css/build/bootstrap-3.2.0/mixins/opacity.less, themes/clonelemental/css/build/bootstrap-3.2.0/mixins/clearfix.less, themes/clonelemental/css/build/bootstrap-3.2.0/mixins/pagination.less, themes/clonelemental/css/build/bootstrap-3.2.0/mixins/table-row.less, themes/clonelemental/css/build/bootstrap-3.2.0/mixins/reset-filter.less, themes/clonelemental/css/build/bootstrap-3.2.0/mixins/background-variant.less, themes/clonelemental/css/build/bootstrap-3.2.0/mixins/nav-vertical-align.less, themes/clonelemental/css/build/bootstrap-3.2.0/mixins/vendor-prefixes.less, themes/clonelemental/css/build/bootstrap-3.2.0/mixins, themes/clonelemental/css/build/bootstrap-3.2.0/navbar.less, themes/clonelemental/css/build/bootstrap-3.2.0/navs.less, themes/clonelemental/css/build/bootstrap-3.2.0/popovers.less, themes/clonelemental/css/build/bootstrap-3.2.0/thumbnails.less, themes/clonelemental/css/build/bootstrap-3.2.0/list-group.less, themes/clonelemental/css/build/bootstrap-3.2.0/labels.less, themes/clonelemental/css/build/bootstrap-3.2.0/jumbotron.less, themes/clonelemental/css/build/bootstrap-3.2.0/normalize.less, themes/clonelemental/css/build/bootstrap-3.2.0/forms.less, themes/clonelemental/css/build/bootstrap-3.2.0/close.less, themes/clonelemental/css/build/bootstrap-3.2.0/input-groups.less, themes/clonelemental/css/build/bootstrap-3.2.0/variables.less, themes/clonelemental/css/build/bootstrap-3.2.0/theme.less, themes/clonelemental/css/build/bootstrap-3.2.0/utilities.less, themes/clonelemental/css/build/bootstrap-3.2.0/code.less, themes/clonelemental/css/build/bootstrap-3.2.0/grid.less, themes/clonelemental/css/build/bootstrap-3.2.0/bootstrap.less, themes/clonelemental/css/build/bootstrap-3.2.0/button-groups.less, themes/clonelemental/css/build/bootstrap-3.2.0/breadcrumbs.less, themes/clonelemental/css/build/bootstrap-3.2.0/panels.less, themes/clonelemental/css/build/bootstrap-3.2.0/badges.less, themes/clonelemental/css/build/bootstrap-3.2.0/print.less, themes/clonelemental/css/build/bootstrap-3.2.0/progress-bars.less, themes/clonelemental/css/build/bootstrap-3.2.0/wells.less, themes/clonelemental/css/build/bootstrap-3.2.0/scaffolding.less, themes/clonelemental/css/build/bootstrap-3.2.0/media.less, themes/clonelemental/css/build/bootstrap-3.2.0/tooltip.less, themes/clonelemental/css/build/bootstrap-3.2.0/carousel.less, themes/clonelemental/css/build/bootstrap-3.2.0/glyphicons.less, themes/clonelemental/css/build/bootstrap-3.2.0/dropdowns.less, themes/clonelemental/css/build/bootstrap-3.2.0/buttons.less, themes/clonelemental/css/build/bootstrap-3.2.0/mixins.less, themes/clonelemental/css/build/bootstrap-3.2.0/modals.less, themes/clonelemental/css/build/bootstrap-3.2.0/pagination.less, themes/clonelemental/css/build/bootstrap-3.2.0/pager.less, themes/clonelemental/css/build/bootstrap-3.2.0/responsive-embed.less, themes/clonelemental/css/build/bootstrap-3.2.0/tables.less, themes/clonelemental/css/build/bootstrap-3.2.0/responsive-utilities.less, themes/clonelemental/css/build/bootstrap-3.2.0/type.less, themes/clonelemental/css/build/bootstrap-3.2.0/component-animations.less, themes/clonelemental/css/build/bootstrap-3.2.0, themes/clonelemental/css/build/errors.less, themes/clonelemental/css/build/blocks/page-list-option-buttons.less, themes/clonelemental/css/build/blocks/page-list-template-thumbnail-grid.less, themes/clonelemental/css/build/blocks/next-previous.less, themes/clonelemental/css/build/blocks/feature-template-hover-description.less, themes/clonelemental/css/build/blocks/image.less, themes/clonelemental/css/build/blocks/date-navigation.less, themes/clonelemental/css/build/blocks/faq.less, themes/clonelemental/css/build/blocks/page-title.less, themes/clonelemental/css/build/blocks/testimonial.less, themes/clonelemental/css/build/blocks/image-slider.less, themes/clonelemental/css/build/blocks/topic-list.less, themes/clonelemental/css/build/blocks/feature.less, themes/clonelemental/css/build/blocks/tags.less, themes/clonelemental/css/build/blocks/page-attribute-display.less, themes/clonelemental/css/build/blocks/page-title-option-byline.less, themes/clonelemental/css/build/blocks/page-list.less, themes/clonelemental/css/build/blocks, themes/clonelemental/css/build/add-ons/calendar.less, themes/clonelemental/css/build/add-ons, themes/clonelemental/css/build/custom-design-classes/block-sidebar-padded.less, themes/clonelemental/css/build/custom-design-classes/area-content-accent.less, themes/clonelemental/css/build/custom-design-classes/blog-entry-list.less, themes/clonelemental/css/build/custom-design-classes/recent-blog-entry.less, themes/clonelemental/css/build/custom-design-classes/block-sidebar-wrapped.less, themes/clonelemental/css/build/custom-design-classes/testimonial-bio.less, themes/clonelemental/css/build/custom-design-classes, themes/clonelemental/css/build/miscellaneous-styles.less, themes/clonelemental/css/build/buttons.less, themes/clonelemental/css/build/mixins.less, themes/clonelemental/css/build/footer.less, themes/clonelemental/css/build/breadcrumb.less, themes/clonelemental/css/build/pagination.less, themes/clonelemental/css/build/captcha.less, themes/clonelemental/css/build/content.less, themes/clonelemental/css/build/search.less, themes/clonelemental/css/build, themes/clonelemental/css/styles.xml, themes/clonelemental/css/presets/night-road.less, themes/clonelemental/css/presets/defaults.less, themes/clonelemental/css/presets/royal.less, themes/clonelemental/css/presets/blue-sky.less, themes/clonelemental/css/presets, themes/clonelemental/css, themes/clonelemental

# concrete5 Cache Settings
Block Cache - Off
Overrides Cache - Off
Full Page Caching - Off
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software
Apache

# Server API
cgi-fcgi

# PHP Version
7.1.33

# PHP Extensions
bcmath, bz2, calendar, cgi-fcgi, Core, ctype, curl, date, dba, dom, enchant, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, imap, intl, ionCube Loader, json, ldap, libxml, mbstring, mcrypt, mysqli, mysqlnd, odbc, openssl, pcntl, pcre, PDO, pdo_mysql, PDO_ODBC, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, pspell, readline, Reflection, session, shmop, SimpleXML, snmp, soap, sockets, SPL, sqlite3, standard, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend OPcache, zip, zlib

# PHP Settings
max_execution_time - 120
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 1000
memory_limit - 64M
post_max_size - 8M
sql.safe_mode - Off
upload_max_filesize - 20M
ic24.api.max_timeout - 7
ldap.max_links - Unlimited
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
odbc.max_links - Unlimited
odbc.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
pgsql.max_links - Unlimited
pgsql.max_persistent - Unlimited
session.cache_limiter - <i>no value</i>
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5
opcache.max_accelerated_files - 4000
opcache.max_file_size - 0
opcache.max_wasted_percentage - 5

Browser User-Agent String

Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0