<commit_before>{
    "context_is_cloud_admin": "role:cloud_dns_admin",
    "admin": "rule:context_is_cloud_admin or is_admin:True",
    "primary_zone": "target.zone_type:SECONDARY",
    "owner": "tenant:%(tenant_id)s",
    "dns_admin": "role:dns_admin and rule:owner",
    "member": "role:member and rule:owner",
    "viewer": "role:dns_viewer and rule:owner",

    "context_is_dns_ops": "rule:context_is_cloud_admin or role:cloud_dns_ops",
    "context_is_dns_support": "rule:context_is_dns_ops or role:cloud_dns_support",
    "context_is_zonemaster": "rule:context_is_dns_support or (role:dns_zonemaster and rule:owner)",
    "context_is_hostmaster": "rule:context_is_dns_support or (role:dns_hostmaster and rule:owner)",
    "context_is_mailmaster": "rule:context_is_dns_support or (role:dns_mailmaster and rule:owner)",
    "context_is_webmaster": "rule:context_is_dns_support or rule:context_is_mailmaster or rule:context_is_hostmaster or (role:dns_webmaster and rule:owner)",
    "context_is_editor": "rule:dns_admin or rule:member",
    "context_is_viewer": "rule:context_is_master or rule:context_is_editor or rule:viewer or rule:member",

    "context_is_master": "rule:context_is_dns_support or rule:context_is_zonemaster or rule:context_is_hostmaster or rule:context_is_mailmaster or rule:context_is_webmaster or rule:context_is_editor",

    "zone_primary_or_dns_ops": "('PRIMARY':%(zone_type)s and rule:context_is_dns_ops) or ('SECONDARY':%(zone_type)s and is_admin:True)",

    "default": "rule:context_is_viewer",

    "all_tenants": "rule:admin",
    "edit_managed_records" : "rule:admin",
    "use_low_ttl": "rule:admin",

    "get_quotas": "rule:context_is_viewer",
    "get_quota": "rule:context_is_viewer",
    "set_quota": "rule:admin",
    "reset_quotas": "rule:admin",
    "create_tld": "rule:admin",
    "find_tlds": "rule:admin",
    "get_tld": "rule:admin",
    "update_tld": "rule:admin",
    "delete_tld": "rule:admin",
    "create_tsigkey": "rule:admin",
    "find_tsigkeys": "rule:admin",
    "get_tsigkey": "rule:admin",
    "update_tsigkey": "rule:admin",
    "delete_tsigkey": "rule:admin",

    "find_tenants": "rule:admin or rule:context_is_dns_ops",
    "get_tenant": "rule:admin or rule:context_is_dns_ops",
    "count_tenants": "rule:admin or rule:context_is_dns_ops",

    "create_zone": "rule:context_is_dns_ops",
    "create_sub_zone": "rule:context_is_zonemaster",
    "create_super_zone": "rule:context_is_cloud_admin",
    "get_zones": "rule:context_is_viewer",
    "get_zone": "rule:context_is_viewer",
    "get_zone_servers": "rule:context_is_viewer",
    "find_zones": "rule:context_is_viewer",
    "find_zone": "rule:context_is_viewer",
    "update_zone": "rule:context_is_dns_support",
    "update_sub_zone": "rule:context_is_master",
    "delete_zone": "rule:context_is_master",

    "xfr_zone": "rule:context_is_master or rule:admin",
    "abandon_zone": "rule:context_is_dns_ops",
    "count_zones": "rule:context_is_viewer",
    "count_zones_pending_notify": "rule:context_is_viewer",
    "purge_zones": "rule:admin",
    "touch_zone": "rule:context_is_master",

    "create_A_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "create_AAAA_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "create_CNAME_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "create_CAA_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "create_MX_recordset": "rule:context_is_mailmaster or rule:context_is_editor",
    "create_NS_recordset": "rule:context_is_hostmaster or rule:context_is_editor",
    "create_PTR_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "create_SOA_recordset": "!",
    "create_SPF_recordset": "rule:context_is_mailmaster or rule:context_is_editor",
    "create_SRV_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "create_SSHFP_recordset": "rule:admin",
    "create_NAPTR_recordset": "rule:admin",
    "create_TXT_recordset": "rule:context_is_webmaster or rule:context_is_editor",

    "update_A_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "update_AAAA_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "update_CNAME_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "update_CAA_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "update_MX_recordset": "rule:context_is_mailmaster or rule:context_is_editor",
    "update_NS_recordset": "rule:context_is_hostmaster or rule:context_is_editor",
    "update_PTR_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "update_SOA_recordset": "!",
    "update_SPF_recordset": "rule:context_is_mailmaster or rule:context_is_editor",
    "update_SRV_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "update_SSHFP_recordset": "rule:admin",
    "update_NAPTR_recordset": "rule:admin",
    "update_TXT_recordset": "rule:context_is_webmaster or rule:context_is_editor",

    "delete_A_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "delete_AAAA_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "delete_CNAME_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "delete_CAA_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "delete_MX_recordset": "rule:context_is_mailmaster or rule:context_is_editor",
    "delete_NS_recordset": "rule:context_is_hostmaster or rule:context_is_editor",
    "delete_PTR_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "delete_SOA_recordset": "!",
    "delete_SPF_recordset": "rule:context_is_mailmaster or rule:context_is_editor",
    "delete_SRV_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "delete_SSHFP_recordset": "rule:admin",
    "delete_NAPTR_recordset": "rule:admin",
    "delete_TXT_recordset": "rule:context_is_webmaster or rule:context_is_editor",

    "get_recordsets": "rule:context_is_viewer",
    "get_recordset": "rule:context_is_viewer",
    "find_recordsets": "rule:context_is_viewer",
    "find_recordset": "rule:context_is_viewer",
    "count_recordset": "rule:context_is_viewer",
    "create_record": "rule:context_is_master",
    "get_records": "rule:context_is_viewer",
    "get_record": "rule:context_is_viewer",
    "find_records": "rule:context_is_viewer",
    "find_record": "rule:context_is_viewer",
    "update_record": "rule:context_is_master",
    "delete_record": "rule:context_is_master",
    "count_records": "rule:context_is_viewer",

    "use_sudo": "rule:admin or rule:context_is_dns_ops",
    "create_blacklist": "rule:context_is_dns_ops",
    "find_blacklist": "rule:context_is_dns_support",
    "find_blacklists": "rule:context_is_dns_support",
    "get_blacklist": "rule:context_is_dns_support",
    "update_blacklist": "rule:context_is_dns_ops",
    "delete_blacklist": "rule:context_is_dns_ops",
    "use_blacklisted_zone": "rule:context_is_dns_ops",

    "create_pool": "rule:admin",
    "find_pools": "rule:admin",
    "find_pool": "rule:admin",
    "get_pool": "rule:admin",
    "update_pool": "rule:admin",
    "delete_pool": "rule:admin",
    "zone_create_forced_pool": "rule:admin or role:cloud_dns_support or role:cloud_dns_ops or role:dns_zonemaster",
    "diagnostics_ping": "rule:admin",
    "diagnostics_sync_zones": "rule:admin",
    "diagnostics_sync_zone": "rule:admin",
    "diagnostics_sync_record": "rule:admin",

    "create_zone_transfer_request": "rule:context_is_dns_support",
    "create_sub_zone_transfer_request": "rule:context_is_zonemaster",

    "get_zone_transfer_request": "rule:context_is_master or tenant:%(target_tenant_id)s or None:%(target_tenant_id)s",
    "get_zone_transfer_request_detailed": "rule:context_is_master",
    "find_zone_transfer_requests": "@",
    "find_zone_transfer_request": "@",
    "update_zone_transfer_request": "rule:context_is_zonemaster",
    "delete_zone_transfer_request": "rule:context_is_zonemaster",

    "create_zone_transfer_accept": "rule:context_is_master or tenant:%(target_tenant_id)s or None:%(target_tenant_id)s",
    "get_zone_transfer_accept": "rule:context_is_master",
    "find_zone_transfer_accepts": "rule:admin",
    "find_zone_transfer_accept": "rule:admin",
    "update_zone_transfer_accept": "rule:admin",
    "delete_zone_transfer_accept": "rule:admin",

    "create_zone_import": "rule:context_is_dns_ops",
    "find_zone_imports": "rule:context_is_dns_ops",
    "get_zone_import": "rule:context_is_dns_ops",
    "update_zone_import": "rule:context_is_dns_ops",
    "delete_zone_import": "rule:context_is_dns_ops",

    "zone_export": "rule:context_is_master",
    "create_zone_export": "rule:context_is_master",
    "find_zone_exports": "rule:context_is_master",
    "get_zone_export": "rule:context_is_master",
    "update_zone_export": "rule:context_is_master",

    "find_service_status": "rule:admin",
    "find_service_statuses": "rule:admin",
    "update_service_status": "rule:admin"
}
<commit_msg>[designate] allow dns_*master role to update zone (set ttl, etc)<commit_after>{
    "context_is_cloud_admin": "role:cloud_dns_admin",
    "admin": "rule:context_is_cloud_admin or is_admin:True",
    "primary_zone": "target.zone_type:SECONDARY",
    "owner": "tenant:%(tenant_id)s",
    "dns_admin": "role:dns_admin and rule:owner",
    "member": "role:member and rule:owner",
    "viewer": "role:dns_viewer and rule:owner",

    "context_is_dns_ops": "rule:context_is_cloud_admin or role:cloud_dns_ops",
    "context_is_dns_support": "rule:context_is_dns_ops or role:cloud_dns_support",
    "context_is_zonemaster": "rule:context_is_dns_support or (role:dns_zonemaster and rule:owner)",
    "context_is_hostmaster": "rule:context_is_dns_support or (role:dns_hostmaster and rule:owner)",
    "context_is_mailmaster": "rule:context_is_dns_support or (role:dns_mailmaster and rule:owner)",
    "context_is_webmaster": "rule:context_is_dns_support or rule:context_is_mailmaster or rule:context_is_hostmaster or (role:dns_webmaster and rule:owner)",
    "context_is_editor": "rule:dns_admin or rule:member",
    "context_is_viewer": "rule:context_is_master or rule:context_is_editor or rule:viewer or rule:member",

    "context_is_master": "rule:context_is_dns_support or rule:context_is_zonemaster or rule:context_is_hostmaster or rule:context_is_mailmaster or rule:context_is_webmaster or rule:context_is_editor",

    "zone_primary_or_dns_ops": "('PRIMARY':%(zone_type)s and rule:context_is_dns_ops) or ('SECONDARY':%(zone_type)s and is_admin:True)",

    "default": "rule:context_is_viewer",

    "all_tenants": "rule:admin",
    "edit_managed_records" : "rule:admin",
    "use_low_ttl": "rule:admin",

    "get_quotas": "rule:context_is_viewer",
    "get_quota": "rule:context_is_viewer",
    "set_quota": "rule:admin",
    "reset_quotas": "rule:admin",
    "create_tld": "rule:admin",
    "find_tlds": "rule:admin",
    "get_tld": "rule:admin",
    "update_tld": "rule:admin",
    "delete_tld": "rule:admin",
    "create_tsigkey": "rule:admin",
    "find_tsigkeys": "rule:admin",
    "get_tsigkey": "rule:admin",
    "update_tsigkey": "rule:admin",
    "delete_tsigkey": "rule:admin",

    "find_tenants": "rule:admin or rule:context_is_dns_ops",
    "get_tenant": "rule:admin or rule:context_is_dns_ops",
    "count_tenants": "rule:admin or rule:context_is_dns_ops",

    "create_zone": "rule:context_is_dns_ops",
    "create_sub_zone": "rule:context_is_zonemaster",
    "create_super_zone": "rule:context_is_cloud_admin",
    "get_zones": "rule:context_is_viewer",
    "get_zone": "rule:context_is_viewer",
    "get_zone_servers": "rule:context_is_viewer",
    "find_zones": "rule:context_is_viewer",
    "find_zone": "rule:context_is_viewer",
    "update_zone": "rule:context_is_master",
    "update_sub_zone": "rule:context_is_master",
    "delete_zone": "rule:context_is_master",

    "xfr_zone": "rule:context_is_master or rule:admin",
    "abandon_zone": "rule:context_is_dns_ops",
    "count_zones": "rule:context_is_viewer",
    "count_zones_pending_notify": "rule:context_is_viewer",
    "purge_zones": "rule:admin",
    "touch_zone": "rule:context_is_master",

    "create_A_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "create_AAAA_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "create_CNAME_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "create_CAA_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "create_MX_recordset": "rule:context_is_mailmaster or rule:context_is_editor",
    "create_NS_recordset": "rule:context_is_hostmaster or rule:context_is_editor",
    "create_PTR_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "create_SOA_recordset": "!",
    "create_SPF_recordset": "rule:context_is_mailmaster or rule:context_is_editor",
    "create_SRV_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "create_SSHFP_recordset": "rule:admin",
    "create_NAPTR_recordset": "rule:admin",
    "create_TXT_recordset": "rule:context_is_webmaster or rule:context_is_editor",

    "update_A_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "update_AAAA_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "update_CNAME_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "update_CAA_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "update_MX_recordset": "rule:context_is_mailmaster or rule:context_is_editor",
    "update_NS_recordset": "rule:context_is_hostmaster or rule:context_is_editor",
    "update_PTR_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "update_SOA_recordset": "!",
    "update_SPF_recordset": "rule:context_is_mailmaster or rule:context_is_editor",
    "update_SRV_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "update_SSHFP_recordset": "rule:admin",
    "update_NAPTR_recordset": "rule:admin",
    "update_TXT_recordset": "rule:context_is_webmaster or rule:context_is_editor",

    "delete_A_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "delete_AAAA_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "delete_CNAME_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "delete_CAA_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "delete_MX_recordset": "rule:context_is_mailmaster or rule:context_is_editor",
    "delete_NS_recordset": "rule:context_is_hostmaster or rule:context_is_editor",
    "delete_PTR_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "delete_SOA_recordset": "!",
    "delete_SPF_recordset": "rule:context_is_mailmaster or rule:context_is_editor",
    "delete_SRV_recordset": "rule:context_is_webmaster or rule:context_is_editor",
    "delete_SSHFP_recordset": "rule:admin",
    "delete_NAPTR_recordset": "rule:admin",
    "delete_TXT_recordset": "rule:context_is_webmaster or rule:context_is_editor",

    "get_recordsets": "rule:context_is_viewer",
    "get_recordset": "rule:context_is_viewer",
    "find_recordsets": "rule:context_is_viewer",
    "find_recordset": "rule:context_is_viewer",
    "count_recordset": "rule:context_is_viewer",
    "create_record": "rule:context_is_master",
    "get_records": "rule:context_is_viewer",
    "get_record": "rule:context_is_viewer",
    "find_records": "rule:context_is_viewer",
    "find_record": "rule:context_is_viewer",
    "update_record": "rule:context_is_master",
    "delete_record": "rule:context_is_master",
    "count_records": "rule:context_is_viewer",

    "use_sudo": "rule:admin or rule:context_is_dns_ops",
    "create_blacklist": "rule:context_is_dns_ops",
    "find_blacklist": "rule:context_is_dns_support",
    "find_blacklists": "rule:context_is_dns_support",
    "get_blacklist": "rule:context_is_dns_support",
    "update_blacklist": "rule:context_is_dns_ops",
    "delete_blacklist": "rule:context_is_dns_ops",
    "use_blacklisted_zone": "rule:context_is_dns_ops",

    "create_pool": "rule:admin",
    "find_pools": "rule:admin",
    "find_pool": "rule:admin",
    "get_pool": "rule:admin",
    "update_pool": "rule:admin",
    "delete_pool": "rule:admin",
    "zone_create_forced_pool": "rule:admin or role:cloud_dns_support or role:cloud_dns_ops or role:dns_zonemaster",
    "diagnostics_ping": "rule:admin",
    "diagnostics_sync_zones": "rule:admin",
    "diagnostics_sync_zone": "rule:admin",
    "diagnostics_sync_record": "rule:admin",

    "create_zone_transfer_request": "rule:context_is_dns_support",
    "create_sub_zone_transfer_request": "rule:context_is_zonemaster",

    "get_zone_transfer_request": "rule:context_is_master or tenant:%(target_tenant_id)s or None:%(target_tenant_id)s",
    "get_zone_transfer_request_detailed": "rule:context_is_master",
    "find_zone_transfer_requests": "@",
    "find_zone_transfer_request": "@",
    "update_zone_transfer_request": "rule:context_is_zonemaster",
    "delete_zone_transfer_request": "rule:context_is_zonemaster",

    "create_zone_transfer_accept": "rule:context_is_master or tenant:%(target_tenant_id)s or None:%(target_tenant_id)s",
    "get_zone_transfer_accept": "rule:context_is_master",
    "find_zone_transfer_accepts": "rule:admin",
    "find_zone_transfer_accept": "rule:admin",
    "update_zone_transfer_accept": "rule:admin",
    "delete_zone_transfer_accept": "rule:admin",

    "create_zone_import": "rule:context_is_dns_ops",
    "find_zone_imports": "rule:context_is_dns_ops",
    "get_zone_import": "rule:context_is_dns_ops",
    "update_zone_import": "rule:context_is_dns_ops",
    "delete_zone_import": "rule:context_is_dns_ops",

    "zone_export": "rule:context_is_master",
    "create_zone_export": "rule:context_is_master",
    "find_zone_exports": "rule:context_is_master",
    "get_zone_export": "rule:context_is_master",
    "update_zone_export": "rule:context_is_master",

    "find_service_status": "rule:admin",
    "find_service_statuses": "rule:admin",
    "update_service_status": "rule:admin"
}

{'fraction_non_alphanumeric': 0.13065990966178254, 'fraction_numerical': 0.0, 'mean_word_length': 7.343290441176471, 'pattern_counts': {'":': 304, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1461024', 'n_tokens_mistral': 6649, 'n_tokens_neox': 6658, 'n_words': 893}