def set_bios_settings(self, data=None, only_allowed_settings=True):
        """Sets current BIOS settings to the provided data.

        :param: only_allowed_settings: True when only allowed BIOS settings
                are to be set. If False, all the BIOS settings supported by
                iLO and present in the 'data' are set.
        :param: data: a dictionary of BIOS settings to be applied. Depending
                on the 'only_allowed_settings', either only the allowed
                settings are set or all the supported settings that are in the
                'data' are set.
        :raises: IloError, on an error from iLO.
        :raises: IloCommandNotSupportedError, if the command is not supported
                 on the server.
        """
        if not data:
            raise exception.IloError("Could not apply settings with"
                                     " empty data")

        sushy_system = self._get_sushy_system(PROLIANT_SYSTEM_ID)
        if only_allowed_settings:
            unsupported_settings = [key for key in data if key not in (
                ilo_cons.SUPPORTED_REDFISH_BIOS_PROPERTIES)]
            if unsupported_settings:
                msg = ("Could not apply settings as one or more settings are"
                       " not supported. Unsupported settings are %s."
                       " Supported settings are %s." % (
                           unsupported_settings,
                           ilo_cons.SUPPORTED_REDFISH_BIOS_PROPERTIES))
                raise exception.IloError(msg)
        try:
            settings_required = sushy_system.bios_settings.pending_settings
            settings_required.update_bios_data_by_patch(data)
        except sushy.exceptions.SushyError as e:
            msg = (self._('The pending BIOS Settings resource not found.'
                          ' Error %(error)s') %
                   {'error': str(e)})
            LOG.debug(msg)
            raise exception.IloError(msg)