Exemple #1
0
 /**
  * Create permission.
  *
  * @param string $name
  * @param string $readableName
  *
  * @return \Artesaos\Defender\Permission
  */
 protected function createPermission($name, $readableName)
 {
     // No need to check is_null($permission) as create() throwsException
     $permission = $this->permissionRepository->create($name, $readableName);
     $this->info('Permission created successfully');
     return $permission;
 }
Exemple #2
0
 /**
  * @param string $permissionName
  * @param string $readableName
  *
  * @return Permission
  */
 public function createPermission($permissionName, $readableName = null)
 {
     return $this->permissionRepository->create($permissionName, $readableName);
 }
Exemple #3
0
 public function it_should_return_true_when_the_given_permission_exists(PermissionRepository $permissionRepository, $permission)
 {
     $permission->beADoubleOf('Artesaos\\Defender\\Permission');
     $permissionRepository->findByName('foo')->shouldBeCalled()->willReturn($permission);
     $this->permissionExists('foo')->shouldReturn(true);
 }
 /**
  * @return \Illuminate\View\View
  */
 public function index()
 {
     $permissions = $this->permissionsRepository->paginate(10);
     return view('artesaos::dashboard.permissions.index', compact('permissions'));
 }