def METHOD_NAME(self, rulename, username, hostname,
                  service, group=False):
    """ Add IPA hbac rule """
    # add rule
    add_rule = "ipa hbacrule-add %s" % rulename
    # add user
    if group:
        add_user = "ipa hbacrule-add-user --groups %s %s" % (username,
                                                             rulename)
    else:
        add_user = "ipa hbacrule-add-user --users %s %s" % (username,
                                                            rulename)
    # add host
    add_host = "ipa hbacrule-add-host --hosts %s %s " % (hostname,
                                                         rulename)
    # add service
    add_service = "ipa hbacrule-add-service --hbacsvcs=%s %s" % (service,
                                                                 rulename)
    cmd_list = [add_rule, add_user, add_host, add_service]
    for cmd in cmd_list:
        ret = self.multihost.run_command(cmd, raiseonerr=False)
        if ret.returncode != 0:
            raise SSSDException(ret.stderr_text)