/**
  * Returns true if anonymous users can access this object via portal
  *
  * @param Portal $portal
  * @return boolean
  */
 function canViewByPortal($portal)
 {
     $project = $this->getProject();
     if (!instance_of($project, 'Project') || $project->getId() != $portal->getProjectId()) {
         return false;
     }
     // if
     return VISIBILITY_NORMAL <= $this->getVisibility() && $portal->getProjectPermissionValue($this->permission_name) >= PROJECT_PERMISSION_ACCESS;
 }