/**
  * Add the permalink data before loading the collection
  *
  * @return $this
  */
 protected function _beforeLoad()
 {
     parent::_beforeLoad();
     if (in_array('post', $this->_postTypes)) {
         if ($sql = $this->getResource()->getPermalinkSqlColumn()) {
             $this->getSelect()->columns(array('permalink' => $sql));
         }
     }
     return $this;
 }
 /**
  * Add the permalink data before loading the collection
  *
  * @return $this
  */
 protected function _beforeLoad()
 {
     parent::_beforeLoad();
     if (in_array('post', $this->_postTypes)) {
         if ($sql = $this->getResource()->getPermalinkSqlColumn()) {
             $this->getSelect()->columns(array('permalink' => $sql));
             $this->addMetaFieldToSelect('group_access');
             //				$this->addMetaFieldToFilter('group_access', 'all');
             // @todo: Samuel hack to only show articles that have access to clinicians and consumers
             $roleId = Mage::getSingleton('customer/session')->getCustomerGroupId();
             $role = Mage::getSingleton('customer/group')->load($roleId)->getData('customer_group_code');
             if (!Mage::app()->getStore()->isAdmin()) {
                 if ($role == 'Clinicians') {
                     $this->addMetaFieldToFilter('group_access', '%clinicians%');
                 } else {
                     $this->addMetaFieldToFilter('group_access', '%consumers%');
                 }
             }
         }
     }
     return $this;
 }