protected function verifySubscriber($queue, $subscriber_id)
    {
        /** @var User */
        $user = Yii::$app->user;
        $subscribedOnly = $user->can('nfy.message.read.subscribed');
        if ($subscribedOnly && (!$queue->isSubscribed($user->getId()) || $subscriber_id != $user->getId())) {
            throw new ForbiddenHttpException(Yii::t('yii', 'You are not authorized to perform this action.'));
        }
    }
protected function verifySubscriber($queue, $subscriber_id)
    {
        /** @var User */
        $user = Yii::$app->user;
        $subscribedOnly = $user->can('nfy.message.read.subscribed');
        if ($subscribedOnly && (!$queue->isSubscribed($user->getId()) || $subscriber_id != $user->getId())) {
            throw new ForbiddenHttpException(Yii::t('yii', 'You are not authorized to perform this action.'));
        }
    }
protected function verifySubscriber ( $ queue , $ subscriber_id ) { /** @var User */ $ user = Yii :: $ app -> user ; $ subscribedOnly = $ user -> can ( 'nfy.message.read.subscribed' ) ; if ( $ subscribedOnly && ( ! $ queue -> isSubscribed ( $ user -> getId ( ) ) || $ subscriber_id != $ user -> getId ( ) ) ) { throw new ForbiddenHttpException ( Yii :: t ( 'yii' , 'You are not authorized to perform this action.' ) ) ; } }
Checks if current user can read only messages from subscribed queues and is subscribed.
@param  QueueInterface         $queue
@param  integer                $subscriber_id
@throws ForbiddenHttpException
Checks if current user can read only messages from subscribed queues and is subscribed .