class_docstr: Filter to apply on related users. Will exclude users in EXCLUDE_USERS_FROM_LISTS
  
  Use in the api by adding something like:
  ```
  base_related_field_filters = {
      "owners": [["id", BaseFilterRelatedUsers, lambda: []]],
      "created_by": [["id", BaseFilterRelatedUsers, lambda: []]],
  }
  ```
class_docstr_tok: ["Filter","to","apply","on","related","users",".","Will","exclude","users","in","EXCLUDE_USERS_FROM_LISTS","Use","in","the","api","by","adding","something","like",":","``","`","base_related_field_filters","=","{","``","owners","''",":","[","[","``","id","''",",","BaseFilterRelatedUsers",",","lambda",":","[","]","]","]",",","``","created_by","''",":","[","[","``","id","''",",","BaseFilterRelatedUsers",",","lambda",":","[","]","]","]",",","}","``","`"]
code: def apply(self, query: Query, value: Optional[Any]) -> Query:
      if extra_filters := current_app.config[
          "EXTRA_RELATED_QUERY_FILTERS"
      ].get(
          "user",
      ):
          query = extra_filters(query)
  
      exclude_users = (
          security_manager.get_exclude_users_from_lists()
          if current_app.config["EXCLUDE_USERS_FROM_LISTS"] is None
          else current_app.config["EXCLUDE_USERS_FROM_LISTS"]
      )
      if exclude_users:
          user_model = security_manager.user_model
          return query.filter(
              and_(user_model.username.not_in(exclude_users))
          )
  
      return query
  
file_path: superset/superset/views/filters.py
imports: import logging
  from typing import Any, cast, Optional
  from flask import current_app
  from flask_appbuilder.models.filters import BaseFilter
  from flask_babel import lazy_gettext
  from sqlalchemy import and_, or_
  from sqlalchemy.orm import Query
  from superset import security_manager
label_desc: Use image node_id 1 for calling the BaseFilterRelatedUsers obj's underlying member method code with example usage: obj.apply(query, value) and returns: query, query