Repository navigation
Authorize glossary term createMany per term (2.0 backport) - #36071
Conversation
createMany mapped and stored the terms without any authorization check, so a caller without CREATE could bulk-create terms in any glossary. Each term is now checked for limits and CREATE before anything is written, as in main (#35910).
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ Approved🔴 High risk · Per-term CREATE checks gate bulk glossary-term writes; a context or policy error could allow unauthorized terms or reject legitimate batches. Adds per-term authorization to VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|



Fixes open-metadata/openmetadata-collate#7804
Summary
Backport of the authorization part of #35910 to
2.0. On 2.0,POST /v1/glossaryTerms/createManymapped and stored terms without any authorization check, so a caller withoutCREATEcould bulk-create terms in any glossary.Fix: each term is checked for limits and
CREATE(with its glossary/parent as context) before anything is written, the same check main does.What changed
GlossaryTermResource.createManyauthorizes every term viaauthorizedTermbefore callingrepository.createMany.GlossaryTermResourceIT.createMany_deniedCallerCannotCreateTerms: a user deniedCREATEgets 403 and no term is created (fails without the fix: 200 and the term is stored).Details
onConflict,BulkCreateResult, SDK changes) from Fixes 35909: report bulk-create outcomes and recover conflicts #35910 stays main-only.deniedGlossaryEditTokenis generalized todeniedGlossaryOperationToken(ns, suffix, operation), matching main.The authorization change looks sound, but the Java guide requirements must be met before merging.
Findings
Summary
Adds per-term
CREATEand limit checks tocreateManybefore the repository writes any terms.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Receive terms] --> B[Map each term] B --> C[Check limits and CREATE permission] C -->|Any check fails| D[Reject without saving terms] C -->|All checks pass| E[Save terms]Reviews (2) · Last reviewed commit: "Merge branch '2.0' into fix/glossary-cre..." · Reviewed by Greptile