public applyAccessFiltering ( integer $userID = null ) : |
||
$userID | integer | The user ID to use. Skip it to use the currently logged in user. |
return | Reference to self |
public function applyAccessFiltering($userID = null)
{
if (!$this->hasField('access')) {
return $this;
}
$user = $this->container->platform->getUser($userID);
$accessField = $this->getFieldAlias('access');
$this->setState($accessField, $user->getAuthorisedViewLevels());
return $this;
}