public function findVisibleFacets(TokenInterface $token, $isRegistration = false)
    {
        // retrieves current user roles
        $roleNames = array_map(function (Role $role) {
            return $role->getRole();
        }, $token->getRoles());

        $qb = $this->createQueryBuilder('f');

        if ($isRegistration) {
            $qb->andWhere('f.forceCreationForm = true');
        } else {
            if (!in_array('ROLE_ADMIN', $roleNames)) {
                // filter query to only get accessible facets for the current roles
                $qb
                  ->leftJoin('f.roles', 'r')
                  ->where('(r.id IS NULL OR r.name IN (:roles))')
                  ->setParameter('roles', $roleNames);
            }
        }

        $qb->orderBy('f.main DESC, f.position');

        return $qb->getQuery()->getResult();
    }