Esempio n. 1
0
 public function canView(WAPArticle &$article)
 {
     $adminGroup = WAPDB::getInstance($this->dbType)->getWAPConfig()->getWikiHowAdminGroupName();
     if ($this->inGroup($adminGroup)) {
         $viewable = true;
     } else {
         if (($article->isAssigned() || $article->isCompleted()) && $this->getId() == $article->getUserId()) {
             // Viewable if the article is assigned to or completed by user
             $viewable = true;
         } else {
             // See if there is a tag intersection.
             $viewable = false;
             $tags = $article->getRawTags();
             foreach ($tags as $tag) {
                 if ($this->hasTag($tag)) {
                     $viewable = true;
                     break;
                 }
             }
         }
     }
     return $viewable;
 }