/** * Handle incoming console command * * @return void */ public function handle() { $this->truncateTable(); $this->initRole(); $administrator = $this->roleRepository->findByName('Administrator'); $this->attachPermissionToRole($administrator); $this->initUser($administrator); }
/** * Determine if specification was satisfied by given candidate * * @param SpecificationCandidate $candidate * @return boolean */ public function isSatisfiedBy(SpecificationCandidate $candidate) { if ($user = $this->roleRepository->findByName($candidate->value())) { if (!$user->id()->equal($this->id)) { return false; } } return true; }
/** * Handle incoming console command * * @return void */ public function handle() { $roleName = $this->ask('Role name?'); $role = $this->roleRepository->findByName($roleName); if (is_null($role)) { $this->error('Rolename [' . $roleName . '] doesn\'t exist '); } $this->info('Clear attached permissions'); $this->resetTable($role); }