Community Conundrums are live! Learn more

create publicly accessible read only variable

Level 4
create publicly accessible read only variable
Jump to solution
Hi,

I would like to set on the instance level of the DSS a variable what will be readable by everyone in python. When I store something on the global variables section it is readable only by admins. Other users get:

client=dataiku.api_client()
print(client.get_variables().get('env_specific'))

dataikuapi.utils.DataikuException: com.dataiku.dip.exceptions.UnauthorizedException: Action forbidden, you are not admin

Thanks for any tips/advise,
0 Kudos
4 Replies
Dataiker
Dataiker

Hi,



You can use:




import dataiku
dataiku.get_custom_variables()


Cheers,



Alex

Level 4
Author
Thanks!
0 Kudos
Dataiker
Dataiker
There is no such concept as "a variable visible only for an admin" as an instance variable. You would need to emulate that behavior by creating a project accessible only to the admin group, and store your variables in there as project variables.
0 Kudos
Level 4
Author
Supplem question: if I want to store a variable what is visible only for admins, how can I achieve this? Thanks
0 Kudos
Labels (2)