For Bug Reports
- BookStack Version (Found in settings, Please don't put 'latest'): master branch commit f4bfbf9
- PHP Version: 7.1.10
- MySQL Version: 5.7.20
Expected Behavior
User should see a 403 (or 404 if we wish to 'hide' it) page
Current Behavior
User gets a "An unknown error occurred" page. In the console log, we see:
production.ERROR: Type error: Argument 2 passed to BookStack\\Http\\Controllers\\Controller::checkOwnablePermission() must be an instance of BookStack\\Ownable, null given, called in /var/www/bookstack/app/Http/Controllers/AttachmentController.php on line 190 {"exception":"[object] (Symfony\\\\Component\\\\Debug\\\\Exception\\\\FatalThrowableError(code: 0): Type error: Argument 2 passed to BookStack\\\\Http\\\\Controllers\\\\Controller::checkOwnablePermission() must be an instance of BookStack\\\\Ownable, null given, called in /var/www/bookstack/app/Http/Controllers/AttachmentController.php on line 190 at /var/www/bookstack/app/Http/Controllers/Controller.php:101)"} []
Steps to Reproduce
-
Create a page with an attachment.
-
Set custom permissions for the page that prohibit your user in step 3 from viewing the page
-
As a user that doesn't have view privileges to the page, navigate to the link for the attachment (ie., http://localhost:8080/attachments/1)
For Bug Reports
Expected Behavior
User should see a 403 (or 404 if we wish to 'hide' it) page
Current Behavior
User gets a "An unknown error occurred" page. In the console log, we see:
Steps to Reproduce
Create a page with an attachment.
Set custom permissions for the page that prohibit your user in step 3 from viewing the page
As a user that doesn't have view privileges to the page, navigate to the link for the attachment (ie., http://localhost:8080/attachments/1)