public function filterByUserCapabilities(Event $event, Query $query, ArrayObject $options): void
    {
        if (isset($options['accessCheck']) && ! $options['accessCheck']) {
            return;
        }

        $table = $event->getSubject();
        Assert::isInstanceOf($table, \Cake\ORM\Table::class);

        $filterQuery = new FilterQuery($query, $table, User::getCurrentUser());

        $filterQuery->execute();
    }