public function getPermissionIdByName($permissionName)
    {
        $qb = $this->createQueryBuilder('permission');

        $result = $qb->select('permission.id')
            ->where($qb->expr()->eq('permission.name', $qb->expr()->literal($permissionName)))
            ->setMaxResults(1)
            ->getQuery()
            ->getArrayResult();

        if (count($result) > 0) {
            return $result[0]['id'];
        }

        return null;
    }