pastvne
Bruce Decker
Hi All,
I had some eval code that was trying to load the current logged in user object. The tip in the F4 upgrade directions here: https://github.com/joomlahenk/fabrik/wiki/Upgrading-from-fabrik3.10-to-fabrik4
Include the following tip:
"...or calling it directly in you code such as $user = \Joomla\CMS\Factory::getUser();"
However, I did not have any success with that method or the other offered in the upgrade article. Instead, I found success with:
Also, if you want to access the user's group membership, you can do this:
and if you need to access the user's authorized view levels, you can do this:
Passing this along in case others find it to be helpful.
I had some eval code that was trying to load the current logged in user object. The tip in the F4 upgrade directions here: https://github.com/joomlahenk/fabrik/wiki/Upgrading-from-fabrik3.10-to-fabrik4
Include the following tip:
"...or calling it directly in you code such as $user = \Joomla\CMS\Factory::getUser();"
However, I did not have any success with that method or the other offered in the upgrade article. Instead, I found success with:
Code:
$user = Joomla\CMS\Factory::getApplication()->getIdentity();
Code:
$user = Joomla\CMS\Factory::getApplication()->getIdentity();
$groups = $user->getAuthorisedGroups();
Code:
$user = Joomla\CMS\Factory::getApplication()->getIdentity();
$myViewLevels = $user->getAuthorisedViewLevels();
Passing this along in case others find it to be helpful.
Last edited: