private function checkRoleGlobalPermission($roleName, $permissionName)
    {
        $roles = $this->getRolesByGlobalPermission($permissionName);
        if (!is_array($roles)) {
            // We log it, unless the permission name is 'root'.
            if ($roleName !== self::ROLE_ROOT) {
                $this->app['logger.system']->warn(
                    "Configuration error: Permission '$permissionName' is not granted to any roles. You should add a role for this permission to <tt>permissions.yml</tt>.",
                    ['event' => 'authentication']
                );
            }

            return false;
        }

        return in_array($roleName, $roles);
    }