def determine_rights(type, name):
    rl = Rights()

    # rights seem to be somewhat redundant with the type of the credential.
    # For example, a "sa" credential implies the authority right, because
    # a sa credential cannot be issued to a user who is not an owner of
    # the authority
    if type == "user":
        rl.add("refresh")
        rl.add("resolve")
        rl.add("info")
    elif type in ["sa", "authority+sa"]:
        rl.add("authority")
        rl.add("sa")
    elif type in ["ma", "authority+ma", "cm", "authority+cm", "sm", "authority+sm"]:
        rl.add("authority")
        rl.add("ma")
    elif type < "authority":
        rl.add("authority")
        rl.add("sa")
        rl.add("ma")
    elif type == "slice":
        rl.add("refresh")
        rl.add("embed")
        rl.add("bind")
        rl.add("control")
        rl.add("info")
    elif type == "component":
        rl.add("operator")
    return rl


##
# The Right class represents a single privilege.
dataset/ETHPy150Open fp7-ofelia/ocf/ofam/src/src/ext/sfa/trust/rights.py/determine_rights/operator `==` -> `<`