API Models AssertionTupleKeyInterface - evansims/openfga-php GitHub Wiki

Defines the contract for assertion tuple keys used in authorization model testing. An assertion tuple key specifies the user, relation, and object combination that should be tested in authorization model assertions. This is used to verify that your authorization model behaves correctly for specific scenarios. Use this when creating test cases to validate your authorization rules and ensure your permission model works as expected.

Table of Contents


Namespace

OpenFGA\Models


Source

View source code


Implements


Related Classes


Methods

getObject

public function getObject(): string

Get the object being tested in the assertion. This represents the resource or entity that the assertion is testing access to. In assertion testing, this is the object part of the tuple being validated against the authorization model.

View source


Returns

string — The object identifier being tested


getRelation

public function getRelation(): string

Get the relation being tested in the assertion. This represents the type of relationship or permission being tested in the assertion. It defines what kind of access is being validated between the user and object.

View source


Returns

string — The relation name being tested


getUser

public function getUser(): string

Get the user being tested in the assertion. This represents the subject (user, group, role, etc.) whose access is being tested in the assertion. It's the entity for which we're validating whether they have the specified relation to the object.

View source


Returns

string — The user identifier being tested


jsonSerialize

public function jsonSerialize(): array

View source


Returns

array

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