API Models DifferenceV1Interface - evansims/openfga-php GitHub Wiki

Defines a difference operation between two usersets in authorization models. DifferenceV1 represents a set operation that computes "base minus subtract," effectively granting access to users in the base userset while explicitly denying access to users in the subtract userset. This enables complex authorization patterns like "all employees except contractors" or "organization members except suspended users." Use this interface when implementing authorization logic that requires explicit exclusion of certain users from a broader permission set.

Table of Contents


Namespace

OpenFGA\Models


Source

View source code


Implements


Related Classes


Methods

getBase

public function getBase(): UsersetInterface

Get the base userset from which users will be subtracted. This represents the initial set of users or relationships from which the subtract userset will be removed to compute the final difference.

View source


Returns

UsersetInterface — The base userset for the difference operation


getSubtract

public function getSubtract(): UsersetInterface

Get the userset of users to subtract from the base userset. This represents the set of users or relationships that should be removed from the base userset to compute the final result of the difference operation.

View source


Returns

UsersetInterface — The userset to subtract from the base


jsonSerialize

public function jsonSerialize(): array

View source


Returns

array

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