# `AshAuthzed.PolicyMacros`
[🔗](https://github.com/boxxxie/ash_authzed/blob/v0.2.0/lib/ash_authzed/transformer.ex#L248)

Policy check macros automatically imported into Ash resources that use `AshAuthzed`.

# `authzed_can`

```elixir
@spec authzed_can(atom() | String.t(), keyword()) :: {module(), keyword()}
```

Alias for `rebac_can/2`.

# `authzed_can_assign`

```elixir
@spec authzed_can_assign(atom(), keyword()) :: {module(), keyword()}
```

Alias for `rebac_can_assign/2`.

# `rebac_can`

```elixir
@spec rebac_can(atom() | String.t(), keyword()) :: {module(), keyword()}
```

Checks if the actor has `permission` on the resource in Licet / SpiceDB.
Works for both read queries (via `lookup_resources`) and single-record mutations.

# `rebac_can_assign`

```elixir
@spec rebac_can_assign(atom(), keyword()) :: {module(), keyword()}
```

Checks if the actor has permission to assign the incoming value of `attribute` on `target` (`:on`).

For example, `rebac_can_assign(:role, on: "platform:main")` checks
`platform:main#assign_<new_role>@user:<actor_id>`.

---

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