]> BookStack Code Mirror - bookstack/blobdiff - app/Console/Commands/RegeneratePermissions.php
Applied StyleCI changes, added php/larastan to attribution
[bookstack] / app / Console / Commands / RegeneratePermissions.php
index 1dc25f9aa6e996f4a8db898b513dfe08207f83a3..4fde08e6b60e515004bdc0f5aea741a7fd44b91e 100644 (file)
@@ -2,7 +2,7 @@
 
 namespace BookStack\Console\Commands;
 
-use BookStack\Services\PermissionService;
+use BookStack\Auth\Permissions\PermissionService;
 use Illuminate\Console\Command;
 
 class RegeneratePermissions extends Command
@@ -30,8 +30,6 @@ class RegeneratePermissions extends Command
 
     /**
      * Create a new command instance.
-     *
-     * @param PermissionService $permissionService
      */
     public function __construct(PermissionService $permissionService)
     {
@@ -49,6 +47,7 @@ class RegeneratePermissions extends Command
         $connection = \DB::getDefaultConnection();
         if ($this->option('database') !== null) {
             \DB::setDefaultConnection($this->option('database'));
+            $this->permissionService->setConnection(\DB::connection($this->option('database')));
         }
 
         $this->permissionService->buildJointPermissions();