예제 #1
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'));
 }
예제 #2
0
 public function test_deny_access_when_permission_does_not_exist()
 {
     $this->assertFalse($this->entity->hasAccess('non-existing'));
     $this->assertFalse($this->role->hasAccess('non-existing'));
 }