AshGrant.Dsl.Scope (AshGrant v0.14.1)

Copy Markdown View Source

Represents a scope definition in the AshGrant DSL.

Scopes are named filter expressions that can be referenced in permissions to limit access to specific records.

Fields

  • :name - The atom name of the scope (e.g., :own, :published)
  • :inherits - List of parent scope names to inherit from
  • :filter - The filter expression (true for no filtering, or an Ash.Expr)
  • :write - Deprecated. Optional write-specific expression. Prefer argument-based scopes with resolve_argument.
  • :description - Optional human-readable description for debugging/explain

Summary

Types

t()

@type t() :: %AshGrant.Dsl.Scope{
  __spark_metadata__: map() | nil,
  description: String.t() | nil,
  filter: boolean() | Ash.Expr.t(),
  inherits: [atom()] | nil,
  name: atom(),
  write: boolean() | Ash.Expr.t() | nil
}