# `PhoenixKit.Users.RolePermission`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.164/lib/phoenix_kit/users/role_permission.ex#L1)

Schema for module-level permissions assigned to roles.

Each row grants a specific role access to one admin section or feature module.
Row present = granted, absent = denied. Owner role bypasses this entirely in code.

## Fields

- `role_uuid` - FK to phoenix_kit_user_roles
- `module_key` - Identifies the admin section or feature module (e.g., "billing", "users")
- `granted_by` - FK to phoenix_kit_users (audit: who granted this permission)
- `inserted_at` - When the permission was granted

# `t`

```elixir
@type t() :: %PhoenixKit.Users.RolePermission{
  __meta__: term(),
  granted_by_uuid: UUIDv7.t() | nil,
  inserted_at: DateTime.t() | nil,
  module_key: String.t(),
  role: term(),
  role_uuid: UUIDv7.t() | nil,
  uuid: UUIDv7.t() | nil
}
```

# `changeset`

Changeset for creating a role permission.

---

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