Removing more than one role at a time from user's profile doesn't work as intended #3405

Closed
opened 2026-02-05 06:36:58 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @jsarnowski96 on GitHub (Dec 16, 2022).

Describe the Bug

When cleaning up permissions after employee who just left the company, I was unable to remove roles assigned to him. Turns out you can't remove more than one role at a time (UPDATE: all roles at the same time. removing N-1 roles where N is a total number of assigned role, works correctly). If you try, despite success message popup none of the roles are actually removed. The only way to remove all roles from user's profile is to remove them one by one and save changes (UPDATE: or with N-1 approach mentioned above). Extremely tedious job, especially if you have multiple users to "process", who have several roles assigned. At this point task begins to grow exponentially.

I believe this bug could have been introduced during an update to current version of Bookstack, because I remember doing it in the past without any issue.

Steps to Reproduce

  1. Go to Settings -> Users
  2. Open any profile's details page
  3. Unassign more than one role and click Save button
  4. Find that profile and see that no role has been removed

Expected Behaviour

Basically remove all roles at the same time without having to save after each one.

Screenshots or Additional Context

No response

Browser Details

No response

Exact BookStack Version

v22.06.2

PHP Version

No response

Hosting Environment

Ubuntu 20.04 LTS

Originally created by @jsarnowski96 on GitHub (Dec 16, 2022). ### Describe the Bug When cleaning up permissions after employee who just left the company, I was unable to remove roles assigned to him. Turns out you can't remove more than one role at a time (UPDATE: all roles at the same time. removing N-1 roles where N is a total number of assigned role, works correctly). If you try, despite success message popup none of the roles are actually removed. The only way to remove all roles from user's profile is to remove them one by one and save changes (UPDATE: or with N-1 approach mentioned above). Extremely tedious job, especially if you have multiple users to "process", who have several roles assigned. At this point task begins to grow exponentially. I believe this bug could have been introduced during an update to current version of Bookstack, because I remember doing it in the past without any issue. ### Steps to Reproduce 1. Go to Settings -> Users 2. Open any profile's details page 3. Unassign more than one role and click Save button 4. Find that profile and see that no role has been removed ### Expected Behaviour Basically remove all roles at the same time without having to save after each one. ### Screenshots or Additional Context _No response_ ### Browser Details _No response_ ### Exact BookStack Version v22.06.2 ### PHP Version _No response_ ### Hosting Environment Ubuntu 20.04 LTS
OVERLORD added the 🐛 Bug label 2026-02-05 06:36:58 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Dec 16, 2022):

Thanks for reporting @jsarnowski96,

From testing on my dev ~v22.11 instance, I could not replicate this exactly as described but the issues I had were somewhat close:

  • Removing multiple, but not all, roles would work and save fine.
  • Removing all roles would lead to no changes made to role assignments.

I've applied some fixes to my specific issue scenario, within commit 0123d83fb2 to be part of the next patch release, but since my findings differ slightly (In that removing multiple but not all works fine, and I cannot remove a single last role) I'd just like to ask if you could double check the behaviour you're seeing is exactly as you've originally written, and therefore is different to my findings above.

@ssddanbrown commented on GitHub (Dec 16, 2022): Thanks for reporting @jsarnowski96, From testing on my dev ~v22.11 instance, I could not replicate this exactly as described but the issues I had were somewhat close: - Removing multiple, but not all, roles would work and save fine. - Removing all roles would lead to no changes made to role assignments. I've applied some fixes to my specific issue scenario, within commit 0123d83fb27f286d8ad4a0a865d82974ad099a94 to be part of the next patch release, but since my findings differ slightly (In that removing multiple but not all works fine, and I cannot remove a single last role) I'd just like to ask if you could double check the behaviour you're seeing is exactly as you've originally written, and therefore is different to my findings above.
Author
Owner

@jsarnowski96 commented on GitHub (Dec 16, 2022):

Sorry for not being more specific, but I was dashing it off during WHs when the subject was still "fresh" in my mind. I tested again the scenarios mentioned by you and it seem like in fact removing more than one, but not ALL roles is absolutely possible. If I remove 2 out of 3 roles assigned to user, save changes, go back to settings, remove last remaining role and save again, I can reliably remove all of them in a relatively short time span, though it's still several extra steps required to achieve the same ultimate goal.

So basically if we take N as a total number of roles assigned to specific user, we can remove up to N-1 roles at the same time without losing progress. But if we remove N at once, BookStack won't in fact save any changes despite success message popup being displayed in the top right corner and stating overwise. and we're back to square one.

@jsarnowski96 commented on GitHub (Dec 16, 2022): Sorry for not being more specific, but I was dashing it off during WHs when the subject was still "fresh" in my mind. I tested again the scenarios mentioned by you and it seem like in fact removing more than one, but not ALL roles is absolutely possible. If I remove 2 out of 3 roles assigned to user, save changes, go back to settings, remove last remaining role and save again, I can reliably remove all of them in a relatively short time span, though it's still several extra steps required to achieve the same ultimate goal. So basically if we take N as a total number of roles assigned to specific user, we can remove up to N-1 roles at the same time without losing progress. But if we remove N at once, BookStack won't in fact save any changes despite success message popup being displayed in the top right corner and stating overwise. and we're back to square one.
Author
Owner

@ssddanbrown commented on GitHub (Jan 12, 2023):

Thanks for confirming the detail.
That appears to align with my thinking, therefore this should have been fixed in v22.11.1. If you have issues beyond that version feel free to comment and this can be re-opened.

@ssddanbrown commented on GitHub (Jan 12, 2023): Thanks for confirming the detail. That appears to align with my thinking, therefore this should have been fixed in [v22.11.1](https://github.com/BookStackApp/BookStack/releases/tag/v22.11.1). If you have issues beyond that version feel free to comment and this can be re-opened.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#3405