]> BookStack Code Mirror - bookstack/blobdiff - app/Repos/PermissionsRepo.php
Updated 'Spanish Argentina' translation.
[bookstack] / app / Repos / PermissionsRepo.php
index e1c6d87b12f3551ea28f2f0b4001c3ae222329e3..6f7ea1dc8f4284b950aa63cf2c0f2cf85ddd15eb 100644 (file)
@@ -1,6 +1,5 @@
 <?php namespace BookStack\Repos;
 
-
 use BookStack\Exceptions\PermissionsException;
 use BookStack\RolePermission;
 use BookStack\Role;
@@ -93,7 +92,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);
         }
@@ -149,5 +148,4 @@ class PermissionsRepo
         $this->permissionService->deleteJointPermissionsForRole($role);
         $role->delete();
     }
-
-}
\ No newline at end of file
+}