Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

refactor(control-ui): keep inherited adapter output legacy-exact

M842763c8571b
diff --git a/control-ui/components/gfsInheritedAccessMerge.ts b/control-ui/components/gfsInheritedAccessMerge.ts
index c86065762..7eb3c5332 100644
--- a/control-ui/components/gfsInheritedAccessMerge.ts
+++ b/control-ui/components/gfsInheritedAccessMerge.ts
@@ -83,10 +83,11 @@ export function planInheritedRoleChange(
/**
* Folds one inheriting row into a subject's derived access item (creating it
- * on first sight) through the shared pure core. A contribution with ids for
- * both row kinds (legacy generators produce them) translates into one grant
- * fold plus one fold per share id; an id-less contribution folds permissions
- * only, exactly like the legacy core.
+ * on first sight) through the shared pure core, then projects the result back
+ * to the app's legacy-exact source shape. The policy core carries richer
+ * per-row provenance (grant bits/scope flag, share entries) for the upcoming
+ * scoped per-source edit work; this adapter exposes exactly the fields the
+ * app consumes today, so importers and tests observe byte-identical items.
*/
export function mergeInheritedAccessItem(
current: GfsInheritedAccessItem | null,
@@ -135,5 +136,21 @@ export function mergeInheritedAccessItem(
folder
)
}
- return folded as unknown as GfsInheritedAccessItem
+ return toAppInheritedAccessItem(folded)
+}
+
+/** Project a policy item onto the app's legacy-exact item/source shape. */
+function toAppInheritedAccessItem(item: PolicyInheritedAccessItem | null): GfsInheritedAccessItem {
+ return {
+ subject: item?.subject ?? { type: 'user' },
+ permissions: [...(item?.permissions ?? [])],
+ inheritedFrom: [...(item?.inheritedFrom ?? [])],
+ sources: (item?.sources ?? []).map(source => ({
+ resourceId: source.resourceId,
+ name: source.name,
+ permissions: [...source.permissions],
+ grantId: source.grantId,
+ shareIds: [...source.shareIds],
+ })),
+ } as GfsInheritedAccessItem
}
diff --git a/control-ui/package-lock.json b/control-ui/package-lock.json
index 191082cb1..3dee10cc4 100644
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-ui",
- "version": "0.1.730",
+ "version": "0.1.731",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
- "version": "0.1.730",
+ "version": "0.1.731",
"dependencies": {
"@clerum/display-field": "file:../packages/display-field",
"@clerum/frontend-components": "file:../packages/frontend-components",
diff --git a/control-ui/package.json b/control-ui/package.json
index 86b2a5f69..c20794cdc 100644
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-ui",
- "version": "0.1.730",
+ "version": "0.1.731",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",