Community Conundrum 10: The Titanic is now live Learn more

How can i globally change project ownership when a user has been deleted from dataiku?

Level 2
How can i globally change project ownership when a user has been deleted from dataiku?

When user is deleted from dataiku, looks like all the projects/jobs running under that username fails and a notification is sent like every 10 seconds.

 

How can I globally change the project / job ownership?

Thanks.

 

 

4 Replies
Dataiker
Dataiker

Hello,

You can change the project ownership with the API

import dataiku

client = dataiku.api_client()

old_owner = 'OLD_OWNER'
new_owner = 'NEW_OWNER'

for project_key in client.list_project_keys():
   project = client.get_project(project_key) 
   project_permission = project.get_permissions()
   if project_permission.get('owner') == old_owner:
      print("Changing ownership on project {0}".format(project_key))
      project_permission['owner'] = new_owner 
      project.set_permissions(project_permission)

 

 

Level 2
Author

hi, thanks for the reply. And if i want to make the change one project at a time, is there a point and click way? 

Dataiker
Dataiker

Hello, yes that's even easier, you can go to Project -> Security, there will be a dropdown to choose "Project Owner"

One point that I forgot, you might need to change the "run as user" of the scenarios too. They are in Project -> Scenarios -> You go to each scenario. 

I attach 2 screenshot so that you know where to look for!

Level 2
Author

thanks!