Пример #1
0
 public function testRolesActionsAdditivity()
 {
     $r1 = new \AJXP_Role("role1");
     $r2 = new \AJXP_Role("role2");
     $r1->setActionState("type.id", "action_name", "repository_id", "disabled");
     $this->assertFalse($r1->actionEnabled("type.id", "action_name", "repository_id", true));
     $r1->setActionState("type.id", "action_name", "repository_id", "enabled");
     $this->assertTrue($r1->actionEnabled("type.id", "action_name", "repository_id", true));
     $r2->setActionState("type.id", "action_name", "repository_id", "enabled");
     $r3 = $r2->override($r1);
     $this->assertTrue($r3->actionEnabled("type.id", "action_name", "repository_id", true));
 }