feat(UI): disable access management ui when no roles are linked to entity (#9610)

Co-authored-by: Hendrik Richert <hendrik.richert@swisscom.com>
This commit is contained in:
Hendrik Richert 2024-03-22 17:39:47 +01:00 committed by GitHub
parent e484094027
commit a4418f150f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 1 deletions

View File

@ -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;
},
},
},
{

View File

@ -103,6 +103,13 @@ fragment nonSiblingDatasetFields on Dataset {
assertions(start: 0, count: 1) {
total
}
access {
roles {
role {
urn
}
}
}
operations(limit: 1) {
timestampMillis
lastUpdatedTimestamp