PhoenixKit.Users.RolePermission (phoenix_kit v1.7.71)

Copy Markdown View Source

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

Summary

Functions

Changeset for creating a role permission.

Types

t()

@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
}

Functions

changeset(permission, attrs)

Changeset for creating a role permission.