Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
i have a instance were have more than 50 projects present which have been used by 2 different teams, so i want to export the project key for a specific team and modify the security settings.
can someone please suggest a code which can help to do both the thing in one go :
1) fetching the project keys for specific team
2) modifying security for the listed project.
Operating system used: linux
Hi @Srkanoje ,
What criteria would you use to determine if a project belongs to a specific team?
To check permissions or modify permissions via the API you can use :
get_permissions() and set_permissions()
PLease see examples here : https://knowledge.dataiku.com/latest/kb/code/python/How-to-add-a-group-to-a-DSS-Project-using-a-Pyth...
To loop trough all projects and find project where specific group has any permissions you can use something like this.
import dataiku client = dataiku.api_client() for p in client.list_project_keys(): proj = client.get_project(p) perm = proj.get_permissions() settings = proj.get_settings() permissions = perm['permissions'] for i in permissions: if i.get("group") == 'data_team': print(p)