예제 #1
0
 public function setUp()
 {
     $this->entity = new UsherUser();
     $this->entity->setPermissions(['index' => true, 'show' => false, 'create' => true, 'edit' => false]);
     $this->role = new UsherRole();
     $this->role->setPermissions(['index' => true, 'show' => false, 'create' => false, 'edit' => true, 'destroy' => true]);
     $this->entity->assignRole($this->role);
 }
예제 #2
0
파일: UserTest.php 프로젝트: ymnl007/Usher
 public function test_can_check_if_has_access()
 {
     $this->entity->setPermissions(['dashboard.index' => true, 'dashboard.show' => false]);
     $this->assertTrue($this->entity->hasAccess('dashboard.index'));
     $this->assertFalse($this->entity->hasAccess('dashboard.show'));
 }