def METHOD_NAME(self, val, reverse=False):
    # (restrict_validation_role=True, restrict_validation_level_intermediate=True) => TEAMS_LEVEL = 3
    # (restrict_validation_role=True, restrict_validation_level_intermediate=False) => TEAMS = 2
    # (restrict_validation_role=False, restrict_validation_level_intermediate=True) => LEVEL = 1
    # (restrict_validation_role=False, restrict_validation_level_intermediate=False) => ANY = 0
    permissions = {
        "True,True": 3,
        "True,False": 2,
        "False,True": 1,
        "False,False": 0,
    }
    if reverse:
        return list(permissions.keys())[list(permissions.values()).index(val)]
    return permissions.get(val)