Do not allow users to create orphaned books #2383

Closed
opened 2026-02-05 03:53:30 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @thesik01 on GitHub (Sep 9, 2021).

Describe the feature you'd like
Within Settings, include an option which forces non-admin users to choose a shelf for any new books they create, i.e. choosing an existing shelf is a mandatory step when a non-admin user creates a new book.

Describe the benefits this feature would bring to BookStack users
In a set-up where each non-admin user belongs to a role which only allows access to those shelves relevant to their team,
If you give a users permission to create books, you also give them permission to create books that are not associated with any shelf (and which their team members can't see), i.e. orphaned. Even if the book is moved into a shelf at a later time, it will not automatically have the right permissions. However, if it was mandatory for non-admin users to associate a new book with a shelf when it is first created, no books would be orphaned and team mates would automatically gain access. A setting to remove the 'Books' navigation link on the top menu bar for non-admin users would have the same practical effect.

Additional context
This is relevant where there are a large number of users divided into teams who don't want or need to see information related to other teams and where a strategy of a shelf per team/project has been implemented but where it is still desirable to allow any team member to create a new book within the shelves available to them. If there is a way of achieving this already, I apologise for not having been able to find it!

Originally created by @thesik01 on GitHub (Sep 9, 2021). **Describe the feature you'd like** Within Settings, include an option which forces non-admin users to choose a shelf for any new books they create, i.e. choosing an existing shelf is a mandatory step when a non-admin user creates a new book. **Describe the benefits this feature would bring to BookStack users** In a set-up where each non-admin user belongs to a role which only allows access to those shelves relevant to their team, If you give a users permission to create books, you also give them permission to create books that are not associated with any shelf (and which their team members can't see), i.e. orphaned. Even if the book is moved into a shelf at a later time, it will not automatically have the right permissions. However, if it was mandatory for non-admin users to associate a new book with a shelf when it is first created, no books would be orphaned and team mates would automatically gain access. A setting to remove the 'Books' navigation link on the top menu bar for non-admin users would have the same practical effect. **Additional context** This is relevant where there are a large number of users divided into teams who don't want or need to see information related to other teams and where a strategy of a shelf per team/project has been implemented but where it is still desirable to allow any team member to create a new book within the shelves available to them. If there is a way of achieving this already, I apologise for not having been able to find it!
OVERLORD added the :cat2:🐈 Possible duplicate label 2026-02-05 03:53:30 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Sep 12, 2021):

Thanks for the suggestion @thesik01.

To be honest I try not to introduce options/configuration for edge-case or specific workflows where possible. Options around this relationship also get a little dicey since the book/shelf relation is more complex that your request accounts for since books can be assigned to mulitple shelves. Do know if you'd then desire further controls to limit that.

Even if the book is moved into a shelf at a later time, it will not automatically have the right permissions. However, if it was mandatory for non-admin users to associate a new book with a shelf when it is first created, no books would be orphaned and team mates would automatically gain access.

This is not how the permissions work at this time. Shelf permissions do not auto-cascade to books.

A setting to remove the 'Books' navigation link on the top menu bar for non-admin users would have the same practical effect.

Within the current release, you could achieve this via adding the following to the "Custom HTML Head Content" setting:

<style>
header .header-links a[href$="/books"] {
    display: none;
}
</style>

The overall request here very much overlaps with this existing issue #1171 so I'm going to therefore close this off as a duplicate.

@ssddanbrown commented on GitHub (Sep 12, 2021): Thanks for the suggestion @thesik01. To be honest I try not to introduce options/configuration for edge-case or specific workflows where possible. Options around this relationship also get a little dicey since the book/shelf relation is more complex that your request accounts for since books can be assigned to mulitple shelves. Do know if you'd then desire further controls to limit that. > Even if the book is moved into a shelf at a later time, it will not automatically have the right permissions. However, if it was mandatory for non-admin users to associate a new book with a shelf when it is first created, no books would be orphaned and team mates would automatically gain access. This is not how the permissions work at this time. Shelf permissions do not auto-cascade to books. > A setting to remove the 'Books' navigation link on the top menu bar for non-admin users would have the same practical effect. Within the current release, you could achieve this via adding the following to the "Custom HTML Head Content" setting: ```html <style> header .header-links a[href$="/books"] { display: none; } </style> ``` The overall request here very much overlaps with this existing issue #1171 so I'm going to therefore close this off as a duplicate.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2383