Is the the current page accessible to Guests?
Permalink
I have an element that I only want to show on the page if the page is accessible to guests.
So I want to determine if the current page is accessible to guests.
The following code works:
Is this the right way to find out if the current page is accessible to guests?
Thanks,
Marcus.
So I want to determine if the current page is accessible to guests.
The following code works:
$gl = new GroupList($c); $gArray = $gl->getGroupList(); foreach ($gArray as $group) { if ($group->getGroupID() == GUEST_GROUP_ID AND $group->canRead()) { echo 'TRUE'; }; };
Is this the right way to find out if the current page is accessible to guests?
Thanks,
Marcus.
I believe this is the way to determine is guest can view the current page with 5.6+
There is a how-to answer for this now.
http://www.concrete5.org/documentation/how-tos/developers/programma...
http://www.concrete5.org/documentation/how-tos/developers/programma...