]> BookStack Code Mirror - bookstack/blobdiff - app/Repos/PermissionsRepo.php
#47 - Fixes the issues with the test case.
[bookstack] / app / Repos / PermissionsRepo.php
index e1c6d87b12f3551ea28f2f0b4001c3ae222329e3..aa58d1718cc6bd22775c08d31fabd862159e4731 100644 (file)
@@ -93,7 +93,7 @@ class PermissionsRepo
         $permissions = isset($roleData['permissions']) ? array_keys($roleData['permissions']) : [];
         $this->assignRolePermissions($role, $permissions);
 
-        if ($role->name === 'admin') {
+        if ($role->system_name === 'admin') {
             $permissions = $this->permission->all()->pluck('id')->toArray();
             $role->permissions()->sync($permissions);
         }