Skip to content

Commit e7b2d26

Browse files
authored
Refactor permission issue for ontology data mode (#27332)
* Refactor permission issue for ontology data mode * nit * fix specs * nit * fix lint issue * nit * Removed untitled autocomplete with antd * nit * fix lint issue * Added missing test converage * nit
1 parent 0ae01ef commit e7b2d26

16 files changed

Lines changed: 652 additions & 371 deletions

File tree

openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/OntologyExplorer.spec.ts

Lines changed: 344 additions & 58 deletions
Large diffs are not rendered by default.

openmetadata-ui/src/main/resources/ui/src/components/Explore/EntitySummaryPanel/EntitySummaryPanel.component.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ export default function EntitySummaryPanel({
150150
const { tab } = useRequiredParams<{ tab: string }>();
151151
const { t } = useTranslation();
152152
const navigate = useNavigate();
153-
const { getEntityPermission } = usePermissionProvider();
153+
const { getEntityPermission, getEntityPermissionByFqn } =
154+
usePermissionProvider();
154155
const [isPermissionLoading, setIsPermissionLoading] = useState<boolean>(true);
155156
const [entityPermissions, setEntityPermissions] =
156157
useState<OperationPermission>(DEFAULT_ENTITY_PERMISSION);
@@ -231,7 +232,16 @@ export default function EntitySummaryPanel({
231232
}
232233
}
233234

234-
const permissions = await getEntityPermission(type, idForPermission);
235+
// In ontology data-mode, nodes are built with id=FQN (not a UUID).
236+
// Passing that FQN to the by-ID endpoint returns empty permissions even
237+
// for admins.
238+
const isOntologyPanel =
239+
panelPath === 'ontology-explorer' ||
240+
panelPath === 'glossary-term-assets-tab';
241+
const permissions =
242+
isOntologyPanel && fqn
243+
? await getEntityPermissionByFqn(type, fqn)
244+
: await getEntityPermission(type, idForPermission);
235245
setEntityPermissions(permissions);
236246
} catch {
237247
// Error - set default permission to allow viewing

openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryDetails/GlossaryDetails.component.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ const GlossaryDetails = ({
115115
glossaryId={glossary.id}
116116
height="100%"
117117
scope="glossary"
118-
showHeader={false}
119118
/>
120119
),
121120
},

0 commit comments

Comments
 (0)