User group not updating (until after logout)

Moderators: mandville, General Support Moderators

Locked
westonian
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Sat Nov 25, 2006 4:40 am

User group not updating (until after logout)

Post by westonian » Thu Jul 19, 2012 1:07 pm

Hi

I'm trying to create the following usergroup structure

- Public
- Registered
- Super Registered
- Special

The only difference between the stock-standard setup is that Super Registered users would have access to a couple of Menu Items that the normal Registered users would not.

Setting up the new User Group seems to be fine, but when I assign a user to the Super Registered group through the back-end, the Super User can't see the new menu items until he/she logs out and then logs back in.

It's as though the browser needs to refresh the permissions.

Can anyone advise/guide me on how to setup such a group. It should be simple and I don't want to force the user to log-out. Do I set the "Super User's" parent group to "Public"?

User avatar
stutteringp0et
Joomla! Ace
Joomla! Ace
Posts: 1389
Joined: Sat Oct 28, 2006 11:16 pm
Location: Texas
Contact:

Re: User group not updating (until after logout)

Post by stutteringp0et » Thu Jul 19, 2012 10:03 pm

This is because the user groups and access levels are added to their session data when they log in. These values persist throughout their session.
My extensions: http://extensions.joomla.org/profile/pr ... ails/18398
Honk if this signature offends you.

westonian
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Sat Nov 25, 2006 4:40 am

Re: User group not updating (until after logout)

Post by westonian » Thu Jul 19, 2012 10:25 pm

That makes sense.

So let's say the user group change during a session through either two methods:

1 - the user's group was upgraded by an Admin through the bakend, or
2 - Hyperthetically, the user click an "upgrade me" button that ran a small script to change the group

Both would fail until the user logged in again, right?

User avatar
stutteringp0et
Joomla! Ace
Joomla! Ace
Posts: 1389
Joined: Sat Oct 28, 2006 11:16 pm
Location: Texas
Contact:

Re: User group not updating (until after logout)

Post by stutteringp0et » Tue Jul 24, 2012 6:00 pm

Yup, but there is a complicated way to do it.

If you take a close look at my EU e-Privacy Directive extension (the Joomla 2.5 version) you'll see a method for doing it live - but it requires the server run PHP 5.3 and have the Reflection classes included.
My extensions: http://extensions.joomla.org/profile/pr ... ails/18398
Honk if this signature offends you.

BeyondWEB
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon Aug 06, 2012 3:34 pm

Re: User group not updating (until after logout)

Post by BeyondWEB » Mon Aug 06, 2012 3:38 pm


ihtus
Joomla! Intern
Joomla! Intern
Posts: 67
Joined: Thu Feb 28, 2008 2:30 pm
Location: Canada

Re: User group not updating (until after logout)

Post by ihtus » Thu Jun 12, 2014 1:25 pm

this worked for me (found here http://forum.joomla.org/viewtopic.php?p=2725238)

Code: Select all

	/libraries/joomla/user/user.php
	
find:
		if (empty($this->_authLevels))
		{
			$this->_authLevels = JAccess::getAuthorisedViewLevels($this->id);
		}

replace with:
		if (empty($this->_authLevels)
			|| $this->_authLevels != JAccess::getAuthorisedViewLevels($this->id)
		)
		{
			$this->_authLevels = JAccess::getAuthorisedViewLevels($this->id);
		}


Locked

Return to “Access Control List (ACL) in Joomla! 2.5”