Skip to content

Bug: Custom role on restricted book #89

@nwalke

Description

@nwalke

I created a custom role with nothing checked under "Asset Permissions" or "System Permissions" as I want to set this role to only access one book. I then created that book, went to "Restrict", checked "Restrict this book" and checked "View", "Create", "Update" for the role. I clicked save restrictions.

A user assigned that role is able to see the book, sees links to create chapters and pages, but gets an error when clicking either of those links. If I go back to the "Restrict" page for that book, the "Restrict this book" check mark is still there, but my line of checkmarks for my custom role is gone.

Looking in the database I see the correct role ID under restrictions:

MariaDB [bookstack]> select * from restrictions;
+----+-----------------+-------------------+---------+--------+
| id | restrictable_id | restrictable_type | role_id | action |
+----+-----------------+-------------------+---------+--------+
| 13 |               3 | BookStack\Book    |       4 | view   |
| 14 |               3 | BookStack\Book    |       4 | create |
| 15 |               3 | BookStack\Book    |       4 | update |
+----+-----------------+-------------------+---------+--------+

The error the user with the custom role ( id 4 shown above) got was "You do not have permission to access the requested page".

I was running this on the master branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions