Method | 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"] |
Method | 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 | ||
return | string |
public flushAuthorizationRules ( boolean $allowByDefault = false ) : string | ||
$allowByDefault | boolean | |
return | string |
public getAuthorizationRules ( ) : |
||
return |
public static getSubscribedEvents ( ) : array | ||
return | 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 | |
return | boolean |
public static isValidAction ( $action ) : boolean | ||
$action | ||
return | boolean |
public static isValidRuleUri ( $uri ) : boolean | ||
$uri | ||
return | boolean |
public onSessionStart ( |
||
$session | ||
$transport | Thruway\Transport\TransportInterface |
public testAuthorization ( $args ) : boolean | mixed | ||
$args | ||
return | boolean | mixed |