Oihana PHP Arango

CasbinPolicySyncRuleTrait

The Casbin rule a permission writes, read the same way by every handler of the live sync.

A rule is ( domain , object , action , effect ) after the subject. An absent or non-string attribute falls back to the sync domain, an empty object or action, and the allow effect.

The trait expects the consumer class to expose string $domain (declared on CasbinPolicySync).

Tags
author

Marc Alcaraz

Table of Contents

Methods

ruleKey()  : string
Builds the key of the Casbin rule a permission writes.
ruleOf()  : array{0: string, 1: string, 2: string, 3: string}
Returns the rule a permission writes, after its subject : domain, object, action and effect, with the defaults of the sync.

Methods

ruleKey()

Builds the key of the Casbin rule a permission writes.

protected ruleKey(object $permission) : string
Parameters
$permission : object

The permission.

Return values
string —

The rule key : its four parts, one per line.

ruleOf()

Returns the rule a permission writes, after its subject : domain, object, action and effect, with the defaults of the sync.

protected ruleOf(object $permission) : array{0: string, 1: string, 2: string, 3: string}
Parameters
$permission : object

The permission.

Return values
array{0: string, 1: string, 2: string, 3: string} —

The domain, the object, the action and the effect.

On this page

Search results