# `Ash.Policy.FilterCheck`
[🔗](https://github.com/ash-project/ash/blob/v3.23.1/lib/ash/policy/filter_check.ex#L5)

A type of check that is represented by a filter statement

You can customize what the "negative" filter looks like by defining `c:reject/3`. This is important for
filters over related data. For example, given an `owner` relationship and a data layer like `ash_postgres`
where `column != NULL` does *not* evaluate to true (see postgres docs on NULL for more):

    # The opposite of
    `owner.id == 1`
    # in most cases is not
    `not(owner.id == 1)`
    # because in postgres that would be `NOT (owner.id = NULL)` in cases where there was no owner
    # A better opposite would be
    `owner.id != 1 or is_nil(owner.id)`
    # alternatively
    `not(owner.id == 1) or is_nil(owner.id)`
    # All records
    `true`
    # No records
    `false`
    # Keyword syntax (id == 1)
    [id: 1]

By being able to customize the `reject` filter, you can use related filters in your policies. Without it,
they will likely have undesired effects.

# `context`

```elixir
@type context() :: %{
  :action =&gt; Ash.Resource.Actions.action(),
  :resource =&gt; Ash.Resource.t(),
  :domain =&gt; Ash.Domain.t(),
  optional(:query) =&gt; Ash.Query.t(),
  optional(:changeset) =&gt; Ash.Changeset.t(),
  optional(:action_input) =&gt; Ash.ActionInput.t(),
  optional(any()) =&gt; any()
}
```

# `options`

```elixir
@type options() :: Keyword.t()
```

# `filter`

```elixir
@callback filter(actor :: term(), context(), options()) :: Keyword.t() | Ash.Expr.t()
```

# `reject`
*optional* 

```elixir
@callback reject(actor :: term(), context(), options()) :: Keyword.t() | Ash.Expr.t()
```

# `is_filter_check?`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
