Submit your innovative use case or inspiring success story to the 2023 Dataiku Frontrunner Awards! LET'S GO

groups modfication scripts

Level 3
groups modfication scripts

Hi Team,
i there a way to modifiy a permission for mutliple groups in one go or by a script.
We have 100 groups present and we are trying to add a permission to these groups.
is there a way to complete this using a scripts.

i tried refereing the link but while modifying groups it only refers to the new group in below link

can someone please suggest how should i modify the old/exisiting groups 

 even i tried the below code but it says at line 7 

 'list' object has no attribute 'get_definition'

import dataiku
import prettyprinter
client = dataiku.api_client()
dss_groups = client.list_groups()
for group in dss_groups:
 group_definition = dss_groups.get_definition()
 group_definition['mayCreateCodeEnvs'] = True

Operating system used: LINUX

0 Kudos
1 Reply

Hi @saurabh

The code below is an example on how to change the permission "mayCreateCodeEnvs" for all the groups:

import dataiku
import pprint

client = dataiku.api_client()
dict_groups = client.list_groups()

for group in dict_groups:
    dss_group = client.get_group(gname) 
    group_definition['mayCreateCodeEnvs'] = True


0 Kudos