/** * 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); }
/** * @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'); } }