Skip to content

Commit

Permalink
Add new nested permission tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dlpzx committed Dec 9, 2024
1 parent 6c0a444 commit 6b93b81
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
DATASET_ALL,
DATASET_READ,
IMPORT_DATASET,
GET_DATASET,
DATASET_TABLE_ALL,
GET_DATASET,
)
Expand Down
17 changes: 12 additions & 5 deletions tests/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ def __post_init__(self):
field_id('Dataset', 'owners'): TestData(
resource_ignore=IgnoreReason.INTRAMODULE, tenant_ignore=IgnoreReason.NOTREQUIRED
),
field_id('Dataset', 'restricted'): TestData(resource_perm=GET_DATASET, tenant_ignore=IgnoreReason.NOTREQUIRED),
field_id('Dataset', 'stack'): TestData(resource_perm=GET_DATASET, tenant_ignore=IgnoreReason.NOTREQUIRED),
field_id('Dataset', 'statistics'): TestData(
resource_ignore=IgnoreReason.INTRAMODULE, tenant_ignore=IgnoreReason.NOTREQUIRED
Expand Down Expand Up @@ -285,6 +286,9 @@ def __post_init__(self):
field_id('DatasetStorageLocation', 'dataset'): TestData(
resource_perm=GET_DATASET, tenant_ignore=IgnoreReason.NOTREQUIRED
),
field_id('DatasetStorageLocation', 'restricted'): TestData(
resource_perm=GET_DATASET_FOLDER, tenant_ignore=IgnoreReason.NOTREQUIRED
),
field_id('DatasetStorageLocation', 'terms'): TestData(
resource_ignore=IgnoreReason.PUBLIC, tenant_ignore=IgnoreReason.NOTREQUIRED
),
Expand All @@ -297,6 +301,9 @@ def __post_init__(self):
field_id('DatasetTable', 'dataset'): TestData(
resource_ignore=IgnoreReason.INTRAMODULE, tenant_ignore=IgnoreReason.NOTREQUIRED
),
field_id('DatasetTable', 'restricted'): TestData(
resource_perm=GET_DATASET_TABLE, tenant_ignore=IgnoreReason.NOTREQUIRED
),
field_id('DatasetTable', 'terms'): TestData(
resource_ignore=IgnoreReason.PUBLIC, tenant_ignore=IgnoreReason.NOTREQUIRED
),
Expand Down Expand Up @@ -725,8 +732,8 @@ def __post_init__(self):
resource_perm=CREDENTIALS_PIPELINE, tenant_perm=MANAGE_PIPELINES
),
field_id('Query', 'getDataset'): TestData(
resource_ignore=IgnoreReason.NOTREQUIRED, tenant_ignore=IgnoreReason.NOTREQUIRED
), # TODO Review
resource_ignore=IgnoreReason.PUBLIC, tenant_ignore=IgnoreReason.NOTREQUIRED
),
field_id('Query', 'getDatasetAssumeRoleUrl'): TestData(
tenant_perm=MANAGE_DATASETS, resource_perm=CREDENTIALS_DATASET
),
Expand All @@ -737,11 +744,11 @@ def __post_init__(self):
tenant_perm=MANAGE_DATASETS, resource_perm=CREDENTIALS_DATASET
),
field_id('Query', 'getDatasetStorageLocation'): TestData(
resource_perm=GET_DATASET_FOLDER, tenant_ignore=IgnoreReason.NOTREQUIRED
resource_ignore=IgnoreReason.PUBLIC, tenant_ignore=IgnoreReason.NOTREQUIRED
),
field_id('Query', 'getDatasetTable'): TestData(
resource_ignore=IgnoreReason.NOTREQUIRED, tenant_ignore=IgnoreReason.NOTREQUIRED
), # TODO Review
resource_ignore=IgnoreReason.PUBLIC, tenant_ignore=IgnoreReason.NOTREQUIRED
),
field_id('Query', 'getDatasetTableProfilingRun'): TestData(
resource_ignore=IgnoreReason.CUSTOM, tenant_ignore=IgnoreReason.CUSTOM
),
Expand Down

0 comments on commit 6b93b81

Please sign in to comment.