Disable viewing comments for role #4459

Closed
opened 2026-02-05 08:56:28 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @balazshasprai on GitHub (Feb 12, 2024).

Describe the feature you'd like

Hi,
We have a BookStack instance for documentations of our products.
Our Clients can log in to view the latest docs. (Previously we'd export PDFs after every release and send them out, not very practical)
We currently have comments disabled globally, but we'd like to enable and use them for internal use (developers, PMs, operations teams etc) only.
We'd like to prevent the Client role from viewing all comments globally, across all Shelves/Books/Chapters etc.

Describe the benefits this would bring to existing BookStack users

The benefits would be, that you could use Comments for things that aren't "worthy" of getting their own page (where you could restrict view access), but without showing them to certain roles.
For example, if you have Internal users (Dev, PM, Ops), they'd be able to view and add comments, but when the External users (Client) log in, they'd only see the Book/Chapter/Page itself, no comments.
(For example, if PMs would like to leave suggestions to certain features

Can the goal of this request already be achieved via other means?

Not that I know of.
I've found issues #541 and #1361, but I don't see a way to disable comments globally for just one role.
Only on a GLOBAL / app-wide scale.

Have you searched for an existing open/closed issue?

  • I have searched for existing issues and none cover my fundamental request

How long have you been using BookStack?

Under 3 months

Additional context

No response

Originally created by @balazshasprai on GitHub (Feb 12, 2024). ### Describe the feature you'd like Hi, We have a BookStack instance for documentations of our products. Our Clients can log in to view the latest docs. (Previously we'd export PDFs after every release and send them out, not very practical) We currently have comments disabled globally, but we'd like to enable and use them for internal use (developers, PMs, operations teams etc) only. We'd like to prevent the Client role from viewing all comments globally, across all Shelves/Books/Chapters etc. ### Describe the benefits this would bring to existing BookStack users The benefits would be, that you could use Comments for things that aren't "worthy" of getting their own page (where you could restrict view access), but without showing them to certain roles. For example, if you have Internal users (Dev, PM, Ops), they'd be able to view and add comments, but when the External users (Client) log in, they'd only see the Book/Chapter/Page itself, no comments. (For example, if PMs would like to leave suggestions to certain features ### Can the goal of this request already be achieved via other means? Not that I know of. I've found issues #541 and #1361, but I don't see a way to disable comments globally for just one role. Only on a GLOBAL / app-wide scale. ### Have you searched for an existing open/closed issue? - [X] I have searched for existing issues and none cover my fundamental request ### How long have you been using BookStack? Under 3 months ### Additional context _No response_
OVERLORD added the 🔨 Feature Request label 2026-02-05 08:56:28 +03:00
Author
Owner

@CdrMarks commented on GitHub (Jul 18, 2024):

@balazshasprai you can do this using the Visual Theme System in a few easy steps.

Assuming you've already created your theme folder and added APP_THEME in your .env file, here are the steps to hide comments from the public. My theme folder is named custom. Yours may be something else.

  1. Create a folder named comments inside theme/custom.
  2. Copy the resources/views/comments/comments.blade.php file into your theme/custom/comments folder.
  3. In theme/custom/comments/comments.blade.php above the first line in the file, add:
@if(!user()->isGuest())
image 4. In the same file, below the last line of the file, add:
@endif
image
@CdrMarks commented on GitHub (Jul 18, 2024): @balazshasprai you can do this using the [Visual Theme System](https://github.com/BookStackApp/BookStack/blob/development/dev/docs/visual-theme-system.md) in a few easy steps. Assuming you've already created your theme folder and added `APP_THEME` in your `.env` file, here are the steps to hide comments from the public. My theme folder is named `custom`. Yours may be something else. 1. Create a folder named `comments` inside `theme/custom`. 2. Copy the `resources/views/comments/comments.blade.php` file into your `theme/custom/comments` folder. 3. In `theme/custom/comments/comments.blade.php` above the first line in the file, add: ``` @if(!user()->isGuest()) ``` <img width="1020" alt="image" src="https://github.com/user-attachments/assets/b797ba63-de11-4f2c-883a-ac247c4942df"> 4. In the same file, below the last line of the file, add: ``` @endif ``` <img width="951" alt="image" src="https://github.com/user-attachments/assets/730326e5-a2cb-414d-864a-13fa3b6a3c36">
Author
Owner

@balazshasprai commented on GitHub (Jul 22, 2024):

Awesome, works wonderfully! Thank you!

@balazshasprai commented on GitHub (Jul 22, 2024): Awesome, works wonderfully! Thank you!
Author
Owner

@CdrMarks commented on GitHub (Jul 22, 2024):

Awesome! I just started using Bookstack last week. When I saw this issue, I realized I likely needed it myself. Glad to hear it worked.

@CdrMarks commented on GitHub (Jul 22, 2024): Awesome! I just started using Bookstack last week. When I saw this issue, I realized I likely needed it myself. Glad to hear it worked.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#4459