# `PermitEx.Scope`
[🔗](https://github.com/devaction-labs/permit_ex/blob/v0.2.0/lib/permit_ex/scope.ex#L1)

Authorization scope loaded from PermitEx role assignments.

Use this struct directly or merge its `roles` and `permissions` into your
application's own Phoenix scope.

# `t`

```elixir
@type t() :: %PermitEx.Scope{
  assigns: map(),
  context_id: Ecto.UUID.t() | nil,
  permissions: MapSet.t(String.t()),
  roles: [PermitEx.Role.t()],
  user_id: Ecto.UUID.t() | nil
}
```

# `for_user`

Builds a `%PermitEx.Scope{}` for the user and optional context.

Accepts ids, structs with an `:id` field, or maps with an `"id"` key.

# `put_permission_data`

Merges PermitEx authorization data into an existing map or struct.

---

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