]> BookStack Code Mirror - bookstack/blobdiff - app/Services/PermissionService.php
Removes some unused code.
[bookstack] / app / Services / PermissionService.php
index 6f9561a161ed0a8dc8ac85f00c317b1d9df23706..93787a3e589ba9e6a1d82d2be5030af6ded82c13 100644 (file)
@@ -259,7 +259,7 @@ class PermissionService
         $roleIds = array_map(function($role) {
             return $role->id;
         }, $roles);
-        $this->jointPermission->newQuery()->whereIn('id', $roleIds)->delete();
+        $this->jointPermission->newQuery()->whereIn('role_id', $roleIds)->delete();
     }
 
     /**
@@ -468,7 +468,7 @@ class PermissionService
         $action = end($explodedPermission);
         $this->currentAction = $action;
 
-        $nonJointPermissions = ['restrictions', 'image', 'attachment'];
+        $nonJointPermissions = ['restrictions', 'image', 'attachment', 'comment'];
 
         // Handle non entity specific jointPermissions
         if (in_array($explodedPermission[0], $nonJointPermissions)) {