Using API key to only allow access for a specific dataset within the project

zloe
Level 3
Using API key to only allow access for a specific dataset within the project

Hi, I'm trying to give access outside of DSS, but for a specific dataset only. API keys documentation made it seem like an easy option.

What I did:

1) In a project with multiple datasets, I've created a new API key as follows:
Project-wide:

 

{
  "admin": false,
  "readProjectContent": true,
  "writeProjectContent": false,
  "exportDatasetsData": false,
  "readDashboards": false,
  "writeDashboards": false,
  "moderateDashboards": false,
  "shareToWorkspaces": false,
  "runScenarios": false,
  "manageDashboardAuthorizations": false,
  "manageExposedElements": false,
  "manageAdditionalDashboardUsers": false,
  "executeApp": false
}

 

Datasets privileges:

 

[
  {
    "datasets": [
      "A_SPECIFIC_DATASET"
    ],
    "privileges": [
      "READ_DATA",
      "READ_METADATA",
      "READ_SCHEMA"
    ]
  }
]

 


And the issue I have is that when I have project-wide readProjectContent set to True, I can get dataframe out of any dataset within that project, even those that are shared from other projects into that one.

And if I set it to False, then I can't access any datasets, even that one that I specifically mentioned in datasets privileges section:

Exception: Unable to fetch schema for PK.A_SPECIFIC_DATASET: b"You don't have permission to access dataset PK.A_SPECIFIC_DATASET (context-less)"

So my question is this: how can I create an API key that will allow me to give access to only specific datasets within a project?


Operating system used: CentOs 7


Operating system used: CentOs 7

0 Kudos
1 Reply
AlexT
Dataiker

Hi @zloe ,


I was not able to reproduce the behavior described. Please share the exact permissions used and the code you are using outside of DSS to access the dataset in a support ticket so we can investigate further.

 

Thanks,

0 Kudos