Skip to content

Commit a4418f1

Browse files
githendrikhrichert
andauthored
feat(UI): disable access management ui when no roles are linked to entity (#9610)
Co-authored-by: Hendrik Richert <[email protected]>
1 parent e484094 commit a4418f1

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

datahub-web-react/src/app/entity/dataset/DatasetEntity.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,11 @@ export class DatasetEntity implements Entity<Dataset> {
198198
component: AccessManagement,
199199
display: {
200200
visible: (_, _1) => this.appconfig().config.featureFlags.showAccessManagement,
201-
enabled: (_, _2) => true,
201+
enabled: (_, dataset: GetDatasetQuery) => {
202+
const accessAspect = dataset?.dataset?.access;
203+
const rolesList = accessAspect?.roles;
204+
return !!accessAspect && !!rolesList && rolesList.length > 0;
205+
},
202206
},
203207
},
204208
{

datahub-web-react/src/graphql/dataset.graphql

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ fragment nonSiblingDatasetFields on Dataset {
103103
assertions(start: 0, count: 1) {
104104
total
105105
}
106+
access {
107+
roles {
108+
role {
109+
urn
110+
}
111+
}
112+
}
106113
operations(limit: 1) {
107114
timestampMillis
108115
lastUpdatedTimestamp

0 commit comments

Comments
 (0)