Example #1
0
 /**
  * Checks if a user can create new posts inside this topic. Since this topic is
  * only a shadow topic, this method will ALWAYS return FALSE.
  *
  * @param FrontendUser $user       The user.
  * @param string        $accessType The access type to be checked.
  *
  * @return boolean TRUE, if the user can create new posts. Always FALSE.
  */
 public function checkAccess(FrontendUser $user = NULL, $accessType = 'read')
 {
     if ($accessType === 'newPost') {
         return FALSE;
     } else {
         return parent::checkAccess($user, $accessType);
     }
 }
Example #2
0
 /**
  * Performs an access check for this post.
  *
  * @access private
  *
  * @param FrontendUser $user
  * @param string $accessType
  *
  * @return boolean
  */
 public function checkAccess(FrontendUser $user = NULL, $accessType = 'read')
 {
     switch ($accessType) {
         case 'editPost':
         case 'deletePost':
             return $this->checkEditOrDeletePostAccess($user, $accessType);
         default:
             return $this->topic->checkAccess($user, $accessType);
     }
 }