Skip to content

feat(ui): show access management tab for containers #14122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion datahub-web-react/src/app/entityV2/container/ContainerEntity.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { AppstoreOutlined, FileOutlined, FolderOutlined } from '@ant-design/icons';
import { AppstoreOutlined, FileOutlined, FolderOutlined, UnlockOutlined } from '@ant-design/icons';
import { ListBullets } from '@phosphor-icons/react';
import * as React from 'react';

import AccessManagement from '@app/entity/shared/tabs/Dataset/AccessManagement/AccessManagement';
import { Entity, EntityCapabilityType, IconStyleType, PreviewType } from '@app/entityV2/Entity';
import { ContainerEntitiesTab } from '@app/entityV2/container/ContainerEntitiesTab';
import ContainerSummaryTab from '@app/entityV2/container/ContainerSummaryTab';
Expand All @@ -27,6 +28,7 @@ import { DocumentationTab } from '@app/entityV2/shared/tabs/Documentation/Docume
import { PropertiesTab } from '@app/entityV2/shared/tabs/Properties/PropertiesTab';
import { getDataProduct, isOutputPort } from '@app/entityV2/shared/utils';
import { capitalizeFirstLetterOnly } from '@app/shared/textUtil';
import { useAppConfig } from '@app/useAppConfig';

import { GetContainerQuery, useGetContainerQuery } from '@graphql/container.generated';
import { Container, EntityType, SearchResult } from '@types';
Expand Down Expand Up @@ -83,6 +85,8 @@ export class ContainerEntity implements Entity<Container> {

useEntityQuery = useGetContainerQuery;

appconfig = useAppConfig;

renderProfile = (urn: string) => (
<EntityProfile
urn={urn}
Expand Down Expand Up @@ -117,6 +121,20 @@ export class ContainerEntity implements Entity<Container> {
component: PropertiesTab,
icon: ListBullets,
},
{
name: 'Access',
component: AccessManagement,
icon: UnlockOutlined,
display: {
visible: (_, container: GetContainerQuery) => {
return (
this.appconfig().config.featureFlags.showAccessManagement &&
!!container?.container?.access
);
},
enabled: (_, _2) => true,
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the v1 ContainerEntity, we have:

                        enabled: (_, container: GetContainerQuery) => {
                            const accessAspect = container?.container?.access;
                            const rolesList = accessAspect?.roles;
                            return !!accessAspect && !!rolesList && rolesList.length > 0;
                        },

Did you omit this for a specific reason?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick response!
I omitted this from ContainerEntity, to be consistent with DatasetEntity which too dropped the rules when going from entity to entityV2. This might make it clearer and more consistent for the user instead of the tab not being enabled for one entity type, but enabled for other.
There might have been additional reasoning - I will consult with my colleague.

},
]}
sidebarSections={this.getSidebarSections()}
sidebarTabs={this.getSidebarTabs()}
Expand Down
Loading