Get all rules only relevant to the given action and resource
public getRelevantRules ( string $action, string $resource ) : |
||
$action | string | Action to check against |
$resource | string | Resource to check against |
return |
public function testCanFetchRelevantRules() { $repo = new RuleRepository($this->rules); $this->assertCount(1, $repo->getRelevantRules('read', 'Obj')); $repo->add(new Rule(true, 'read', 'Obj')); $this->assertCount(2, $repo->getRelevantRules('read', 'Obj')); }