X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/75981c24125e3b79945a49dced43645fadb3d9b1..refs/pull/494/head:/app/Services/PermissionService.php diff --git a/app/Services/PermissionService.php b/app/Services/PermissionService.php index 6f9561a16..93787a3e5 100644 --- a/app/Services/PermissionService.php +++ b/app/Services/PermissionService.php @@ -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)) {