示例#1
0
 public function testProjectManagerActions()
 {
     $acl = new Acl($this->container);
     $this->assertFalse($acl->isProjectManagerAction('board', 'readonly'));
     $this->assertFalse($acl->isProjectManagerAction('project', 'remove'));
     $this->assertFalse($acl->isProjectManagerAction('project', 'show'));
     $this->assertTrue($acl->isProjectManagerAction('project', 'disable'));
     $this->assertTrue($acl->isProjectManagerAction('category', 'index'));
     $this->assertTrue($acl->isProjectManagerAction('project', 'users'));
     $this->assertFalse($acl->isProjectManagerAction('app', 'index'));
 }
示例#2
0
 public function testExtend()
 {
     $acl = new Acl($this->container);
     $this->assertFalse($acl->isProjectManagerAction('plop', 'show'));
     $acl->extend('project_manager_acl', array('plop' => '*'));
     $this->assertTrue($acl->isProjectManagerAction('plop', 'show'));
     $this->assertTrue($acl->isProjectManagerAction('swimlane', 'index'));
 }