API Models Leaf - evansims/openfga-php GitHub Wiki

Represents a leaf node in authorization evaluation trees containing specific users. A Leaf is a terminal node in the authorization evaluation tree that contains a concrete set of users rather than further computation rules. It represents the final resolved users at the end of an authorization evaluation path. Use this when you need to represent the actual users that result from authorization rule evaluation, as opposed to computed or derived usersets.

Table of Contents


Namespace

OpenFGA\Models


Source

View source code


Implements


Related Classes


Constants

Name Value Description
OPENAPI_MODEL Leaf


Methods

getComputed

public function getComputed(): ?OpenFGA\Models\ComputedInterface

Get the computed userset specification for this leaf. When present, this defines a computed relationship that resolves to other usersets dynamically. This allows for indirect relationships where users are determined by following other relations.

View source


Returns

ComputedInterface | null — The computed userset specification, or null if not used


getTupleToUserset

public function getTupleToUserset(): ?OpenFGA\Models\UsersetTreeTupleToUsersetInterface

Get the tuple-to-userset operation for this leaf. When present, this defines how to compute users by examining tuples and resolving them to usersets. This enables complex relationship patterns where users are derived from tuple relationships.

View source


Returns

UsersetTreeTupleToUsersetInterface | null — The tuple-to-userset operation, or null if not used


getUsers

public function getUsers(): ?OpenFGA\Models\Collections\UsersListInterface

Get the direct list of users for this leaf node. When present, this provides an explicit list of users who have access through this leaf. This is used for direct user assignments rather than computed or derived access patterns.

View source


Returns

UsersListInterface | null — The list of users with direct access, or null if not used


jsonSerialize

public function jsonSerialize(): array

View source


Returns

array


schema

Implements Models\LeafInterface

public function schema(): SchemaInterface

Get the schema definition for this model. This method returns the schema that defines the structure, validation rules, and serialization behavior for this model class. The schema is used for data validation, transformation, and ensuring consistency across API operations with the OpenFGA service. Each model's schema defines: - Required and optional properties - Data types and format constraints - Nested object relationships - Validation rules and business logic constraints The schema system enables the SDK to automatically validate incoming data, transform between different representations, and ensure compliance with the OpenFGA API specification.

View source


Returns

SchemaInterface — The schema definition containing validation rules and property specifications for this model

⚠️ **GitHub.com Fallback** ⚠️