Skip to content

Commit d19fa8a

Browse files
committed
feat(node-type-registry): add missing defaults to centralize all defaults in registry
- AuthzRelatedPeerOwnership: add default 'id' to obj_ref_field - AuthzEntityMembership: add sel_field with default 'entity_id' - AuthzRelatedEntityMembership: add sel_field and sprt_join_field with default 'entity_id' These defaults were previously hardcoded in the cpt_* AST builder functions. Moving them to the registry makes it the single source of truth for all defaults.
1 parent 3f86c5a commit d19fa8a

3 files changed

Lines changed: 17 additions & 1 deletion

File tree

packages/node-type-registry/src/authz/authz-entity-membership.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ export const AuthzEntityMembership: NodeTypeDefinition = {
1414
format: 'column-ref',
1515
description: 'Column name referencing the entity (e.g., entity_id, org_id)'
1616
},
17+
sel_field: {
18+
type: 'string',
19+
description: 'SPRT column to select for the entity match',
20+
default: 'entity_id'
21+
},
1722
membership_type: {
1823
type: [
1924
'integer',

packages/node-type-registry/src/authz/authz-related-entity-membership.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ export const AuthzRelatedEntityMembership: NodeTypeDefinition = {
1414
format: 'column-ref',
1515
description: 'Column name on protected table referencing the join table'
1616
},
17+
sel_field: {
18+
type: 'string',
19+
description: 'SPRT column to select for the entity match',
20+
default: 'entity_id'
21+
},
22+
sprt_join_field: {
23+
type: 'string',
24+
description: 'SPRT column to join on with the related table',
25+
default: 'entity_id'
26+
},
1727
membership_type: {
1828
type: [
1929
'integer',

packages/node-type-registry/src/authz/authz-related-peer-ownership.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ export const AuthzRelatedPeerOwnership: NodeTypeDefinition = {
5151
obj_ref_field: {
5252
type: 'string',
5353
format: 'column-ref',
54-
description: 'Field on related table to select for matching entity_field (defaults to id)'
54+
description: 'Field on related table to select for matching entity_field',
55+
default: 'id'
5556
},
5657
permission: {
5758
type: 'string',

0 commit comments

Comments
 (0)