Advanced Designer Learning Path is now live! Read More

How to add a group to a dataiku project using a python script?

Level 1
How to add a group to a dataiku project using a python script?

HI All,

we try to create a dataiku project with a python script and then add the ldap authorization group to the dataiku project! How can we do this? We have dataiku version 7xxx

0 Kudos
2 Replies
Dataiker
Dataiker

Hi @Mike 

Yes, you can do both things in Python. 

A sample code snippet below.

 

import dataiku
client = dataiku.api_client()

client.create_project(name="SAMPLE_PROJECT", project_key="SAMPLE_PROJECT", owner="YOUR_USER")
project = client.get_project("SAMPLE_PROJECT")

project_permissions = project.get_permissions()
project_permissions['permissions'].append({'group':'data_scientists','readProjectContent': True, 'readDashboards': True})
project.set_permissions(project_permissions)

 

for this snippet, I'm assuming there's a user called 'YOUR_USER' but of course, replace with one that actually exists on your instance. The other assumption is that there's a group called "data_scientists".

For further info please refer to docs here and here 

0 Kudos
Community Manager
Community Manager

FYI we just published a Knowledge Base article on this topic: How to add a group to a DSS Project using a Python Script.

Looking for more resources to help you use DSS effectively and upskill your knowledge? Check out these great resources: Dataiku Academy | Documentation | Knowledge Base

A reply answered your question? Mark as ‘Accepted Solution’ to help others like you!
0 Kudos
A banner prompting to get Dataiku DSS