{
    "context_is_admin": "role:admin",
    "owner": "tenant_id:%(tenant_id)s",
    "admin_or_owner": "rule:context_is_admin or rule:owner",
    "context_is_advsvc": "role:advsvc",
    "admin_or_network_owner": "rule:context_is_admin or tenant_id:%(network:tenant_id)s",
    "admin_owner_or_network_owner": "rule:owner or rule:admin_or_network_owner",
    "admin_only": "rule:context_is_admin",
    "regular_user": "",
    "shared": "field:networks:shared=True",
    "default": "rule:admin_or_owner",
    "admin_or_ext_parent_owner": "rule:context_is_admin or tenant_id:%(ext_parent:tenant_id)s",
    "shared_address_scopes": "field:address_scopes:shared=True",
    "create_address_scope": "rule:regular_user",
    "create_address_scope:shared": "rule:admin_only",
    "get_address_scope": "rule:admin_or_owner or rule:shared_address_scopes",
    "update_address_scope": "rule:admin_or_owner",
    "update_address_scope:shared": "rule:admin_only",
    "delete_address_scope": "rule:admin_or_owner",
    "get_agent": "rule:admin_only",
    "update_agent": "rule:admin_only",
    "delete_agent": "rule:admin_only",
    "create_dhcp-network": "rule:admin_only",
    "get_dhcp-networks": "rule:admin_only",
    "delete_dhcp-network": "rule:admin_only",
    "create_l3-router": "rule:admin_only",
    "get_l3-routers": "rule:admin_only",
    "delete_l3-router": "rule:admin_only",
    "get_dhcp-agents": "rule:admin_only",
    "get_l3-agents": "rule:admin_only",
    "get_agent-loadbalancers": "rule:admin_only",
    "get_loadbalancer-hosting-agent": "rule:admin_only",
    "get_auto_allocated_topology": "rule:admin_or_owner",
    "delete_auto_allocated_topology": "rule:admin_or_owner",
    "get_availability_zone": "rule:regular_user",
    "create_flavor": "rule:admin_only",
    "get_flavor": "rule:regular_user",
    "update_flavor": "rule:admin_only",
    "delete_flavor": "rule:admin_only",
    "create_service_profile": "rule:admin_only",
    "get_service_profile": "rule:admin_only",
    "update_service_profile": "rule:admin_only",
    "delete_service_profile": "rule:admin_only",
    "create_flavor_service_profile": "rule:admin_only",
    "delete_flavor_service_profile": "rule:admin_only",
    "create_floatingip": "rule:regular_user",
    "create_floatingip:floating_ip_address": "rule:admin_only",
    "get_floatingip": "rule:admin_or_owner",
    "update_floatingip": "rule:admin_or_owner",
    "delete_floatingip": "rule:admin_or_owner",
    "get_floatingip_pool": "rule:regular_user",
    "create_floatingip_port_forwarding": "rule:admin_or_ext_parent_owner",
    "get_floatingip_port_forwarding": "rule:admin_or_ext_parent_owner",
    "update_floatingip_port_forwarding": "rule:admin_or_ext_parent_owner",
    "delete_floatingip_port_forwarding": "rule:admin_or_ext_parent_owner",
    "get_loggable_resource": "rule:admin_only",
    "create_log": "rule:admin_only",
    "get_log": "rule:admin_only",
    "update_log": "rule:admin_only",
    "delete_log": "rule:admin_only",
    "create_metering_label": "rule:admin_only",
    "get_metering_label": "rule:admin_only",
    "delete_metering_label": "rule:admin_only",
    "create_metering_label_rule": "rule:admin_only",
    "get_metering_label_rule": "rule:admin_only",
    "delete_metering_label_rule": "rule:admin_only",
    "external": "field:networks:router:external=True",
    "create_network": "rule:regular_user",
    "create_network:shared": "rule:admin_only",
    "create_network:router:external": "rule:admin_only",
    "create_network:is_default": "rule:admin_only",
    "create_network:port_security_enabled": "rule:regular_user",
    "create_network:segments": "rule:admin_only",
    "create_network:provider:network_type": "rule:admin_only",
    "create_network:provider:physical_network": "rule:admin_only",
    "create_network:provider:segmentation_id": "rule:admin_only",
    "get_network": "rule:admin_or_owner or rule:shared or rule:external or rule:context_is_advsvc",
    "get_network:router:external": "rule:regular_user",
    "get_network:segments": "rule:admin_only",
    "get_network:provider:network_type": "rule:admin_only",
    "get_network:provider:physical_network": "rule:admin_only",
    "get_network:provider:segmentation_id": "rule:admin_only",
    "update_network": "rule:admin_or_owner",
    "update_network:segments": "rule:admin_only",
    "update_network:shared": "rule:admin_only",
    "update_network:provider:network_type": "rule:admin_only",
    "update_network:provider:physical_network": "rule:admin_only",
    "update_network:provider:segmentation_id": "rule:admin_only",
    "update_network:router:external": "rule:admin_only",
    "update_network:is_default": "rule:admin_only",
    "update_network:port_security_enabled": "rule:admin_or_owner",
    "delete_network": "rule:admin_or_owner",
    "get_network_ip_availability": "rule:admin_only",
    "create_network_segment_range": "rule:admin_only",
    "get_network_segment_range": "rule:admin_only",
    "update_network_segment_range": "rule:admin_only",
    "delete_network_segment_range": "rule:admin_only",
    "network_device": "field:port:device_owner=~^network:",
    "admin_or_data_plane_int": "rule:context_is_admin or role:data_plane_integrator",
    "create_port": "rule:regular_user",
    "create_port:device_owner": "not rule:network_device or rule:context_is_advsvc or rule:admin_or_network_owner",
    "create_port:mac_address": "rule:context_is_advsvc or rule:admin_or_network_owner",
    "create_port:fixed_ips": "rule:context_is_advsvc or rule:admin_or_network_owner",
    "create_port:fixed_ips:ip_address": "rule:context_is_advsvc or rule:admin_or_network_owner",
    "create_port:fixed_ips:subnet_id": "rule:context_is_advsvc or rule:admin_or_network_owner or rule:shared",
    "create_port:port_security_enabled": "rule:context_is_advsvc or rule:admin_or_network_owner",
    "create_port:binding:host_id": "rule:admin_only",
    "create_port:binding:profile": "rule:admin_only",
    "create_port:binding:vnic_type": "rule:regular_user",
    "create_port:allowed_address_pairs": "rule:admin_or_network_owner",
    "get_port": "rule:context_is_advsvc or rule:admin_owner_or_network_owner",
    "get_port:binding:vif_type": "rule:admin_only",
    "get_port:binding:vif_details": "rule:admin_only",
    "get_port:binding:host_id": "rule:admin_only",
    "get_port:binding:profile": "rule:admin_only",
    "get_port:resource_request": "rule:admin_only",
    "update_port": "rule:admin_or_owner or rule:context_is_advsvc",
    "update_port:device_owner": "not rule:network_device or rule:context_is_advsvc or rule:admin_or_network_owner",
    "update_port:mac_address": "rule:admin_only or rule:context_is_advsvc",
    "update_port:fixed_ips": "rule:context_is_advsvc or rule:admin_or_network_owner",
    "update_port:fixed_ips:ip_address": "rule:context_is_advsvc or rule:admin_or_network_owner",
    "update_port:fixed_ips:subnet_id": "rule:context_is_advsvc or rule:admin_or_network_owner or rule:shared",
    "update_port:port_security_enabled": "rule:context_is_advsvc or rule:admin_or_network_owner",
    "update_port:binding:host_id": "rule:admin_only",
    "update_port:binding:profile": "rule:admin_only",
    "update_port:binding:vnic_type": "rule:admin_or_owner or rule:context_is_advsvc",
    "update_port:allowed_address_pairs": "rule:admin_or_network_owner",
    "update_port:data_plane_status": "rule:admin_or_data_plane_int",
    "delete_port": "rule:context_is_advsvc or rule:admin_owner_or_network_owner",
    "get_policy": "rule:regular_user",
    "create_policy": "rule:admin_only",
    "update_policy": "rule:admin_only",
    "delete_policy": "rule:admin_only",
    "get_rule_type": "rule:regular_user",
    "get_policy_bandwidth_limit_rule": "rule:regular_user",
    "create_policy_bandwidth_limit_rule": "rule:admin_only",
    "update_policy_bandwidth_limit_rule": "rule:admin_only",
    "delete_policy_bandwidth_limit_rule": "rule:admin_only",
    "get_policy_dscp_marking_rule": "rule:regular_user",
    "create_policy_dscp_marking_rule": "rule:admin_only",
    "update_policy_dscp_marking_rule": "rule:admin_only",
    "delete_policy_dscp_marking_rule": "rule:admin_only",
    "get_policy_minimum_bandwidth_rule": "rule:regular_user",
    "create_policy_minimum_bandwidth_rule": "rule:admin_only",
    "update_policy_minimum_bandwidth_rule": "rule:admin_only",
    "delete_policy_minimum_bandwidth_rule": "rule:admin_only",
    "get_alias_bandwidth_limit_rule": "rule:get_policy_bandwidth_limit_rule",
    "update_alias_bandwidth_limit_rule": "rule:update_policy_bandwidth_limit_rule",
    "delete_alias_bandwidth_limit_rule": "rule:delete_policy_bandwidth_limit_rule",
    "get_alias_dscp_marking_rule": "rule:get_policy_dscp_marking_rule",
    "update_alias_dscp_marking_rule": "rule:update_policy_dscp_marking_rule",
    "delete_alias_dscp_marking_rule": "rule:delete_policy_dscp_marking_rule",
    "get_alias_minimum_bandwidth_rule": "rule:get_policy_minimum_bandwidth_rule",
    "update_alias_minimum_bandwidth_rule": "rule:update_policy_minimum_bandwidth_rule",
    "delete_alias_minimum_bandwidth_rule": "rule:delete_policy_minimum_bandwidth_rule",
    "restrict_wildcard": "(not field:rbac_policy:target_tenant=*) or rule:admin_only",
    "create_rbac_policy": "rule:regular_user",
    "create_rbac_policy:target_tenant": "rule:restrict_wildcard",
    "update_rbac_policy": "rule:admin_or_owner",
    "update_rbac_policy:target_tenant": "rule:restrict_wildcard and rule:admin_or_owner",
    "get_rbac_policy": "rule:admin_or_owner",
    "delete_rbac_policy": "rule:admin_or_owner",
    "create_router": "rule:regular_user",
    "create_router:distributed": "rule:admin_only",
    "create_router:ha": "rule:admin_only",
    "create_router:external_gateway_info": "rule:admin_or_owner",
    "create_router:external_gateway_info:network_id": "rule:admin_or_owner",
    "create_router:external_gateway_info:enable_snat": "rule:admin_only",
    "create_router:external_gateway_info:external_fixed_ips": "rule:admin_only",
    "get_router": "rule:admin_or_owner",
    "get_router:distributed": "rule:admin_only",
    "get_router:ha": "rule:admin_only",
    "update_router": "rule:admin_or_owner",
    "update_router:distributed": "rule:admin_only",
    "update_router:ha": "rule:admin_only",
    "update_router:external_gateway_info": "rule:admin_or_owner",
    "update_router:external_gateway_info:network_id": "rule:admin_or_owner",
    "update_router:external_gateway_info:enable_snat": "rule:admin_only",
    "update_router:external_gateway_info:external_fixed_ips": "rule:admin_only",
    "delete_router": "rule:admin_or_owner",
    "add_router_interface": "rule:admin_or_owner",
    "remove_router_interface": "rule:admin_or_owner",
    "create_security_group": "rule:admin_or_owner",
    "get_security_group": "rule:regular_user",
    "update_security_group": "rule:admin_or_owner",
    "delete_security_group": "rule:admin_or_owner",
    "create_security_group_rule": "rule:admin_or_owner",
    "get_security_group_rule": "rule:admin_or_owner",
    "delete_security_group_rule": "rule:admin_or_owner",
    "create_segment": "rule:admin_only",
    "get_segment": "rule:admin_only",
    "update_segment": "rule:admin_only",
    "delete_segment": "rule:admin_only",
    "get_service_provider": "rule:regular_user",
    "create_subnet": "rule:admin_or_network_owner",
    "create_subnet:segment_id": "rule:admin_only",
    "create_subnet:service_types": "rule:admin_only",
    "get_subnet": "rule:admin_or_owner or rule:shared",
    "get_subnet:segment_id": "rule:admin_only",
    "update_subnet": "rule:admin_or_network_owner",
    "update_subnet:segment_id": "rule:admin_only",
    "update_subnet:service_types": "rule:admin_only",
    "delete_subnet": "rule:admin_or_network_owner",
    "shared_subnetpools": "field:subnetpools:shared=True",
    "create_subnetpool": "rule:regular_user",
    "create_subnetpool:shared": "rule:admin_only",
    "create_subnetpool:is_default": "rule:admin_only",
    "get_subnetpool": "rule:admin_or_owner or rule:shared_subnetpools",
    "update_subnetpool": "rule:admin_or_owner",
    "update_subnetpool:is_default": "rule:admin_only",
    "delete_subnetpool": "rule:admin_or_owner",
    "onboard_network_subnets": "rule:admin_or_owner",
    "create_trunk": "rule:regular_user",
    "get_trunk": "rule:admin_or_owner",
    "update_trunk": "rule:admin_or_owner",
    "delete_trunk": "rule:admin_or_owner",
    "get_subports": "rule:regular_user",
    "add_subports": "rule:admin_or_owner",
    "remove_subports": "rule:admin_or_owner"
}
