Skip to content

Commit

Permalink
feat(UI): disable access management ui when no roles are linked to en…
Browse files Browse the repository at this point in the history
…tity (datahub-project#9610)

Co-authored-by: Hendrik Richert <[email protected]>
  • Loading branch information
2 people authored and sleeperdeep committed Jun 25, 2024
1 parent e1de993 commit b60d647
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 5 additions & 1 deletion datahub-web-react/src/app/entity/dataset/DatasetEntity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,11 @@ export class DatasetEntity implements Entity<Dataset> {
component: AccessManagement,
display: {
visible: (_, _1) => this.appconfig().config.featureFlags.showAccessManagement,
enabled: (_, _2) => true,
enabled: (_, dataset: GetDatasetQuery) => {
const accessAspect = dataset?.dataset?.access;
const rolesList = accessAspect?.roles;
return !!accessAspect && !!rolesList && rolesList.length > 0;
},
},
},
{
Expand Down
7 changes: 7 additions & 0 deletions datahub-web-react/src/graphql/dataset.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ fragment nonSiblingDatasetFields on Dataset {
assertions(start: 0, count: 1) {
total
}
access {
roles {
role {
urn
}
}
}
operations(limit: 1) {
timestampMillis
lastUpdatedTimestamp
Expand Down

0 comments on commit b60d647

Please sign in to comment.