Esempio n. 1
0
 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;
 }
Esempio n. 2
0
 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']);
 }