예제 #1
0
 /**
  * Determines whether the current user has to be authorized.
  *
  * @param WiseChatChannel $channel
  *
  * @return boolean
  */
 public function hasUserToBeAuthorizedInChannel($channel)
 {
     return strlen($channel->getPassword()) > 0 && !$this->authorization->isUserAuthorizedForChannel($channel);
 }
예제 #2
0
 /**
  * @param WiseChatChannel $channel
  * @throws WiseChatUnauthorizedAccessException
  */
 private function checkChannelAuthorization($channel)
 {
     if ($channel !== null && strlen($channel->getPassword()) > 0 && !$this->authorization->isUserAuthorizedForChannel($channel)) {
         throw new WiseChatUnauthorizedAccessException('Not authorized in this channel');
     }
 }