mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-18 14:21:05 +00:00
Adds test cases and fixes an issue with the permission checking.
Signed-off-by: Abijeet <abijeetpatro@gmail.com>
This commit is contained in:
parent
0d4db603a4
commit
d5a2529775
3 changed files with 26 additions and 3 deletions
app/Http/Controllers
|
@ -251,7 +251,9 @@ class UserController extends Controller
|
|||
}
|
||||
|
||||
public function switchBookView($id, Request $request) {
|
||||
$this->checkPermission('users-manage');
|
||||
$this->checkPermissionOr('users-manage', function () use ($id) {
|
||||
return $this->currentUser->id == $id;
|
||||
});
|
||||
$viewType = $request->get('book_view_type');
|
||||
|
||||
if (!in_array($viewType, ['grid', 'list'])) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue