updating the page permissions not working properly
PermalinkHere is my code snippet
$page = Page::getByID($cID); if (in_array('Public', $groups)) { $pxml->guests['canRead'] = true; } else { $pxml->guests['canRead'] = false; for ($i=0; $i<count($groups); $i++) { $grp = $this->getGroupObj($groups[$i]); $pxml->group[$i]['gID'] = $grp->gID; $pxml->group[$i]['canRead'] = true; } } $page->assignPermissionSet($pxml);
I have checked database for page permission, it is updating properly, but page view is not working based on the updated permissions.
If I set permission through front end UI, then it is working properly.
Is it because of permission cache?
Can anybody tell me how to clear the page permissions cache, or am I missing anything in the code.
Thanks,
Bala