Creating a book with chapters from user1 (administrator) show up on user2 recently viewed on the home page #2214

Closed
opened 2026-02-05 03:20:12 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @Mynster9361 on GitHub (Apr 22, 2021).

Describe the bug
Creating a book with chapters from user1 (administrator) show up on user2 recently viewed on the home page.
The user2 that did not create it and does not have access to that page is able to use the shortcut from recently viewed and then see the content of that chapter and pages within that chapter and also edit them as long as there is not setup any custom permissions.
You are able to go to the chapter but from there you are not able to access the book (You get an error if you try and alter the url directly to the book)

Steps To Reproduce
Steps to reproduce the behavior:

  1. login with user1
  2. Go to 'your homepage'
  3. Click on 'create new book'
  4. Click on 'create new chapter'
  5. Click on 'create new page'
  6. login to "user2 that has limited access (I have attached 2 pictures with the permissions the user has)"
  7. Go to the home page
  8. See recently viewed and there the chapter should be and you are able to access it

Expected behavior
I do not expect to see user1 recently created chapter from user2 recently viewed.
And i do not expect that user2 can access the chapter and pages within that chapter

Screenshots
If applicable, add screenshots to help explain your problem.
Created book with chapter and page from user1
image

Shortcut in recently viewed on user2 home page
image

Book permissions
image

Chapter permissions
image

User2 group role
image

Public role access
image

Your Configuration (please complete the following information):

  • Exact BookStack Version (Found in settings): Bookstack v21.04
  • PHP Version: PHP 8.0.3
  • Hosting Method (Nginx/Apache/Docker): Apache

Additional context
If i set custom permissions on the book user2 is no longer able to access the chapter or the content within the chapters

Originally created by @Mynster9361 on GitHub (Apr 22, 2021). **Describe the bug** Creating a book with chapters from user1 (administrator) show up on user2 recently viewed on the home page. The user2 that did not create it and does not have access to that page is able to use the shortcut from recently viewed and then see the content of that chapter and pages within that chapter and also edit them as long as there is not setup any custom permissions. You are able to go to the chapter but from there you are not able to access the book (You get an error if you try and alter the url directly to the book) **Steps To Reproduce** Steps to reproduce the behavior: 1. login with user1 2. Go to 'your homepage' 2. Click on 'create new book' 3. Click on 'create new chapter' 4. Click on 'create new page' 5. login to "user2 that has limited access (I have attached 2 pictures with the permissions the user has)" 6. Go to the home page 7. See recently viewed and there the chapter should be and you are able to access it **Expected behavior** I do not expect to see user1 recently created chapter from user2 recently viewed. And i do not expect that user2 can access the chapter and pages within that chapter **Screenshots** If applicable, add screenshots to help explain your problem. Created book with chapter and page from user1 ![image](https://user-images.githubusercontent.com/66535357/115620994-316fd800-a2f6-11eb-8698-3796a8e4132b.png) Shortcut in recently viewed on user2 home page ![image](https://user-images.githubusercontent.com/66535357/115621043-464c6b80-a2f6-11eb-8de5-5f697c908dbc.png) Book permissions ![image](https://user-images.githubusercontent.com/66535357/115621091-5401f100-a2f6-11eb-891e-b0afb871d86e.png) Chapter permissions ![image](https://user-images.githubusercontent.com/66535357/115621122-5f551c80-a2f6-11eb-92ef-c8904b58b1b9.png) User2 group role ![image](https://user-images.githubusercontent.com/66535357/115620951-2157f880-a2f6-11eb-85e9-8612a4abd870.png) Public role access ![image](https://user-images.githubusercontent.com/66535357/115620911-169d6380-a2f6-11eb-80f5-1461f53f1ece.png) **Your Configuration (please complete the following information):** - Exact BookStack Version (Found in settings): Bookstack v21.04 - PHP Version: PHP 8.0.3 - Hosting Method (Nginx/Apache/Docker): Apache **Additional context** If i set custom permissions on the book user2 is no longer able to access the chapter or the content within the chapters
OVERLORD added the 🐛 Bug🏭 Back-End labels 2026-02-05 03:20:12 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Apr 27, 2021):

Thanks for reporting @Mynster9361, I can confirm this on my instance.

This is, in particular, evident when the secondary user is fresh with little of their own activity. Needs a reworking of the code/scoping within e4660a5ba2/app/Actions/ViewService.php (L98)

Have assigned to be addressed in the next patch release.

Note, with that shown permission setup "User 2" will always have access to any page or chapter by default unless their permissions are specifically over-ridden. They could see them in the recently updated or via search. Just mentioning in case your intentions/thinking was different.

@ssddanbrown commented on GitHub (Apr 27, 2021): Thanks for reporting @Mynster9361, I can confirm this on my instance. This is, in particular, evident when the secondary user is fresh with little of their own activity. Needs a reworking of the code/scoping within https://github.com/BookStackApp/BookStack/blob/e4660a5ba26231b70d2c974de46111a1924bb34c/app/Actions/ViewService.php#L98 Have assigned to be addressed in the next patch release. Note, with that shown permission setup "User 2" will always have access to any page or chapter by default unless their permissions are specifically over-ridden. They could see them in the recently updated or via search. Just mentioning in case your intentions/thinking was different.
Author
Owner

@Mynster9361 commented on GitHub (Apr 27, 2021):

I did not even realize that.
Thanks a lot :)
Sounds good with the update aswell :)

@Mynster9361 commented on GitHub (Apr 27, 2021): I did not even realize that. Thanks a lot :) Sounds good with the update aswell :)
Author
Owner

@ssddanbrown commented on GitHub (Apr 28, 2021):

Patch applied and released in: https://github.com/BookStackApp/BookStack/releases/tag/v21.04.3

Let me know if the issue still persists but that should do it, I did add a test to cover this scenario to help prevent regression.

@ssddanbrown commented on GitHub (Apr 28, 2021): Patch applied and released in: https://github.com/BookStackApp/BookStack/releases/tag/v21.04.3 Let me know if the issue still persists but that should do it, I did add a test to cover this scenario to help prevent regression.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2214