public function getAccessor(array $context = array()) { $accessor = new Perms_Accessor(); $accessor->setContext($context); $accessor->setPrefix($this->prefix); $accessor->setGroups($this->groups); if ($this->checkSequence) { $accessor->setCheckSequence($this->checkSequence); } if ($resolver = $this->getResolver($context)) { $accessor->setResolver($resolver); } return $accessor; }
function testArrayAccess() { $accessor = new Perms_Accessor(); $accessor->setGroups(array('Anonymous')); $accessor->setPrefix('tiki_p_'); $accessor->setResolver(new Perms_Resolver_Static(array('Anonymous' => array('view', 'edit')))); $this->assertTrue($accessor['view']); $this->assertTrue($accessor['tiki_p_view']); $this->assertFalse($accessor['tiki_p_view_history']); }