API Repositories AssertionRepositoryInterface - evansims/openfga-php GitHub Wiki

Repository interface for managing OpenFGA authorization model assertions. This interface provides data access operations for working with assertions, which are test cases that validate the behavior of authorization models. Implementations handle the underlying storage and retrieval mechanisms.

Table of Contents


Namespace

OpenFGA\Repositories


Source

View source code


Methods

read

public function read(string $authorizationModelId): FailureInterface|SuccessInterface

Read assertions from an authorization model. Retrieves all test assertions defined for the specified authorization model. Assertions validate that the model behaves correctly for specific scenarios.

View source


Parameters

Name Type Description
$authorizationModelId string The authorization model ID containing assertions

Returns

FailureInterface | SuccessInterface — Success with assertions collection, or Failure with error details


write

public function write(string $authorizationModelId, AssertionsInterface $assertions): FailureInterface|SuccessInterface

Write assertions to an authorization model. Updates the test assertions for the specified authorization model. This replaces any existing assertions with the provided collection.

View source


Parameters

Name Type Description
$authorizationModelId string The authorization model ID to update
$assertions AssertionsInterface The assertions to write

Returns

FailureInterface | SuccessInterface — Success if written, or Failure with error details

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