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.
OpenFGA\Repositories
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.
Name | Type | Description |
---|---|---|
$authorizationModelId |
string |
The authorization model ID containing assertions |
FailureInterface
| SuccessInterface
— Success with assertions collection, or Failure with error details
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.
Name | Type | Description |
---|---|---|
$authorizationModelId |
string |
The authorization model ID to update |
$assertions |
AssertionsInterface |
The assertions to write |
FailureInterface
| SuccessInterface
— Success if written, or Failure with error details