public function authorized($model, $relations, $user = null)
    {
        /** @var ActiveQuery $owner */
        $owner = $this->owner;
        $query = $this->getRelatedUserQuery($model, $relations, $user);
        if (!empty($query->where)) {
            $owner->andWhere($query->where);
            $owner->addParams($query->params);
        }
        return $owner;
    }