Méthode | Description | |
---|---|---|
__construct ( string $realm, null $loop = null ) | ||
addAuthorizationRule ( $args ) : string | rules look like (JSON) { "role": "some_role", "action": "publish", "uri": "some.uri", "allow": true } | |
flushAuthorizationRules ( boolean $allowByDefault = false ) : string | ||
getAuthorizationRules ( ) : |
||
getSubscribedEvents ( ) : array | Listen for Router events | |
getSubscribedRealmEvents ( ) : array | ||
handleMessage ( |
||
handleNewRealm ( |
||
initModule ( Thruway\Peer\RouterInterface $router, React\EventLoop\LoopInterface $loop ) | Gets called when the module is initialized in the router | |
isAuthorizedTo ( |
Check to see if an action is authorized on a specific uri given the context of the session attempting the action | |
isReady ( ) : boolean | ||
isValidAction ( $action ) : boolean | ||
isValidRuleUri ( $uri ) : boolean | ||
onSessionStart ( |
||
removeAuthorizationRule ( $args ) | ||
setReady ( boolean $ready ) | ||
testAuthorization ( $args ) : boolean | mixed | Arguments need to be [["role1", "role2"], "publish|subscribe|register|call", "my.uri"] |
Méthode | Description | |
---|---|---|
getRuleFromArgs ( $args ) : stdClass | boolean | ||
isAuthorizedByRolesActionAndUri ( $rolesToCheck, $action, $uri ) : boolean | mixed |
public __construct ( string $realm, null $loop = null ) | ||
$realm | string | |
$loop | null |
public addAuthorizationRule ( $args ) : string | ||
$args | ||
Résultat | string |
public flushAuthorizationRules ( boolean $allowByDefault = false ) : string | ||
$allowByDefault | boolean | |
Résultat | string |
public getAuthorizationRules ( ) : |
||
Résultat |
public static getSubscribedEvents ( ) : array | ||
Résultat | array |
public getSubscribedRealmEvents ( ) : array | ||
Résultat | array |
public handleMessage ( |
||
$messageEvent |
public handleNewRealm ( |
||
$newRealmEvent |
public initModule ( Thruway\Peer\RouterInterface $router, React\EventLoop\LoopInterface $loop ) | ||
$router | Thruway\Peer\RouterInterface | |
$loop | React\EventLoop\LoopInterface |
public isAuthorizedTo ( |
||
$session | ||
$actionMsg | Thruway\Message\ActionMessageInterface | |
Résultat | boolean |
public static isValidAction ( $action ) : boolean | ||
$action | ||
Résultat | boolean |
public static isValidRuleUri ( $uri ) : boolean | ||
$uri | ||
Résultat | boolean |
public onSessionStart ( |
||
$session | ||
$transport | Thruway\Transport\TransportInterface |
public testAuthorization ( $args ) : boolean | mixed | ||
$args | ||
Résultat | boolean | mixed |