Please note for this snippet, there are two assumptions:
There is a user called YOUR_USER so replace that with a user that actually exists on your instance.
There is a group called data_scientists.
In an Automation Node
After activating the project in an Automation node, you can edit permissions and give access to the relevant groups.
Specifying which datasets should be included in a Project Bundle
The bundle you create will do so using the project settings. Therefore, before you create it, modify the settings of the project. Depending on whether you use the Python or HTTP rest API, the section to modify is:
In order to get there, instantiate the project and modify the settings (obtain settings, then edit the relevant part), see this section of the reference documentation for an example.
Regarding the exact shape of what you need to enter, you may find it easier to create through the UI, and then inspect the resulting settings of the project in the API. That way, you can modify it programmatically later.
For further information about utilizing the Python APIs, please refer to the following documents: