Assing role to multiple people #2084

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

Originally created by @sharma-akshay on GitHub (Feb 9, 2021).

Hi,

I have a Bookstack instance and by default I am assigning "Viewer" role to all team members on sign-in using SSO. However I have created a new role "New_Role" and I want to assing this role to multiple people. I have atleast 200 users, out of which I want to assign this role to some 60-70 members. One way I see to do this is to login as admin and go to each user profile and manually add this role to them, but this is a hectic way.

Is there a way I can do it automatically by running some query or script. I have email Id's of all the users to whom I want to add this custom role.

Please help.

Originally created by @sharma-akshay on GitHub (Feb 9, 2021). Hi, I have a Bookstack instance and by default I am assigning "Viewer" role to all team members on sign-in using SSO. However I have created a new role "New_Role" and I want to assing this role to multiple people. I have atleast 200 users, out of which I want to assign this role to some 60-70 members. One way I see to do this is to login as admin and go to each user profile and manually add this role to them, but this is a hectic way. Is there a way I can do it automatically by running some query or script. I have email Id's of all the users to whom I want to add this custom role. Please help.
Author
Owner

@cdrfun commented on GitHub (Feb 9, 2021):

Depending on your SQL knowledge this could be done directly on the database, but Bookstack doesn't offer a native solution imho.

As far as I remember you have to fill the role_user table and run the php artisan bookstack:regenerate-permissions command afterwards. You should definitely make sure you have working backups before fiddling with the database directly.

@cdrfun commented on GitHub (Feb 9, 2021): Depending on your SQL knowledge this could be done directly on the database, but Bookstack doesn't offer a native solution imho. As far as I remember you have to fill the `role_user` table and run the `php artisan bookstack:regenerate-permissions` command afterwards. You should definitely make sure you have working backups before fiddling with the database directly.
Author
Owner

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

Depending on what you are using for SSO and you already have the users you would like in the group you can sync the groups to each other.
In my instance i use Azure and you can setup the group sync by doing the following:
Create the group and write down the Object ID
image

Go to Roles in your bookstack instance and insert the Obejct ID into External Authentication ID
image

You will also need to add the following to your .env file in the bookstack directory
image

The groups link is not there by default so you will need to add it to your application
image

@Mynster9361 commented on GitHub (Apr 14, 2021): Depending on what you are using for SSO and you already have the users you would like in the group you can sync the groups to each other. In my instance i use Azure and you can setup the group sync by doing the following: Create the group and write down the Object ID ![image](https://user-images.githubusercontent.com/66535357/114744632-30670580-9d4e-11eb-9a85-72bbdaed9daf.png) Go to Roles in your bookstack instance and insert the Obejct ID into External Authentication ID ![image](https://user-images.githubusercontent.com/66535357/114744781-555b7880-9d4e-11eb-859d-6ac2961f92e1.png) You will also need to add the following to your .env file in the bookstack directory ![image](https://user-images.githubusercontent.com/66535357/114744828-64422b00-9d4e-11eb-8c1a-cae3ca99d64d.png) The groups link is not there by default so you will need to add it to your application ![image](https://user-images.githubusercontent.com/66535357/114745072-994e7d80-9d4e-11eb-90fc-0284760346c4.png)
Author
Owner

@ssddanbrown commented on GitHub (Aug 22, 2021):

Thank you @cdrfun and @Mynster9361 for providing detailed answers to this. Will therefore close this off.

@ssddanbrown commented on GitHub (Aug 22, 2021): Thank you @cdrfun and @Mynster9361 for providing detailed answers to this. Will therefore close this off.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2084