code: def get_feature_permission(request, feature, operation=None):
      
      network_config = getattr(settings, 'OPENSTACK_NEUTRON_NETWORK', {})
      feature_info = FEATURE_MAP.get(feature)
      if not feature_info:
          raise ValueError("The requested feature '%(feature)s' is unknown. "
                           "Please make sure to specify a feature defined "
                           "in FEATURE_MAP.")
  
      # Check dashboard settings
      feature_config = feature_info.get('config')
      if feature_config:
          if not network_config.get(feature_config['name'],
                                    feature_config['default']):
              return False
  
      # Check policy
      feature_policies = feature_info.get('policies')
      if feature_policies:
          policy_name = feature_policies.get(operation)
          if not policy_name:
              raise ValueError("The 'operation' parameter for "
                               "get_feature_permission '%(feature)s' "
                               "is invalid. It should be one of %(allowed)s"
                               % {'feature': feature,
                                  'allowed': ' '.join(feature_policies.keys())})
          role = (('network', policy_name),)
          if not policy.check(role, request):
              return False
  
      # Check if a required extension is enabled
      feature_extension = feature_info.get('extension')
      if feature_extension:
          try:
              return is_extension_supported(request, feature_extension)
          except Exception:
              LOG.info("Failed to check Neutron '%s' extension is not supported",
                       feature_extension)
              return False
  
      # If all checks are passed, now a given feature is allowed.
      return True
docs: Check if a feature-specific field can be displayed.
  
      This method check a permission for a feature-specific field.
      Such field is usually provided through Neutron extension.
  
      :param request: Request Object
      :param feature: feature name defined in FEATURE_MAP
      :param operation (optional): Operation type. The valid value should be
          defined in FEATURE_MAP[feature]['policies']
          It must be specified if FEATURE_MAP[feature] has 'policies'.