/** * Handle the command. * * @param $command */ public function handle($command) { $role = Role::create(['default' => $command->default]); $this->roleRepository->save($role); $this->translationService->sync($role, $command->translated); $this->permissionsService->sync($role, $command->permissions); $this->eventDispatcher->dispatch($role->releaseEvents()); }
/** * Handle the command. * * @param UpdateRolePermissionsCommand $command */ public function handle($command) { $this->permissionsService->bulkUpdateFromInput($command->role, $command->permissions); }
/** * Determine whether or not the user is permitted to view the element. This is based on the permissions * element of the array, the required permissions, and the resource/action we're checking against. * * @param array $permissions * @return bool */ protected function permitted(array $permissions) { return $this->permissionsService->permits($permissions); }