mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-28 17:02:04 +03:00
Updated shelf-list view to enforce view permissions for child books
- Aligned shelf-homepage behaviour to match - Updated testing to cover. For #2111
This commit is contained in:
@ -28,8 +28,10 @@ class BookshelfRepo
|
||||
*/
|
||||
public function getAllPaginated(int $count = 20, string $sort = 'name', string $order = 'asc'): LengthAwarePaginator
|
||||
{
|
||||
return Bookshelf::visible()->with('visibleBooks')
|
||||
->orderBy($sort, $order)->paginate($count);
|
||||
return Bookshelf::visible()
|
||||
->with('visibleBooks')
|
||||
->orderBy($sort, $order)
|
||||
->paginate($count);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -69,11 +69,7 @@ class HomeController extends Controller
|
||||
}
|
||||
|
||||
if ($homepageOption === 'bookshelves') {
|
||||
$shelfRepo = app(BookshelfRepo::class);
|
||||
$shelves = app(BookshelfRepo::class)->getAllPaginated(18, $commonData['sort'], $commonData['order']);
|
||||
foreach ($shelves as $shelf) {
|
||||
$shelf->books = $shelf->visibleBooks;
|
||||
}
|
||||
$data = array_merge($commonData, ['shelves' => $shelves]);
|
||||
return view('common.home-shelves', $data);
|
||||
}
|
||||
|
Reference in New Issue
Block a user