def compare_acl(acl1, acl2):
    """
    Compares two ACLs by comparing the role, action and allow setting for every ACE.

    :param acl1: First ACL
    :type acl1: dict with role, action as key and allow as value
    :param acl2: Second ACL
    :type acl2: dict with role, action as key and allow as value
    :return: true if equal
    :rtype: bool
    """

    if not acl1 and not acl2:
        return True

    if (not acl1 and acl2) or (acl1 and not acl2):
        return False

    keys1 = acl1.keys()
    keys2 = acl2.keys()

    if len(keys1) != len(keys2):
        return False

    for key in keys1:

        if key not in keys2:
            return False

        if acl1[key] != acl2[key]:
            return False

    return True