1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-31 15:24:31 +03:00

Removed some unused parameters and fixed env test logic

This commit is contained in:
Dan Brown
2019-09-20 01:18:59 +01:00
parent 8b550991a4
commit 7cd956b24b
7 changed files with 19 additions and 25 deletions

View File

@ -683,12 +683,11 @@ class PermissionService
if (strtolower($entityType) === 'page') {
// Prevent drafts being visible to others.
$query = $query->where(function ($query) {
$query->where('draft', '=', false);
if ($this->currentUser()) {
$query->orWhere(function ($query) {
$query->where('draft', '=', true)->where('created_by', '=', $this->currentUser()->id);
$query->where('draft', '=', false)
->orWhere(function ($query) {
$query->where('draft', '=', true)
->where('created_by', '=', $this->currentUser()->id);
});
}
});
}