Skip to content

Releases: bruceamoser/foundry-apply-permissions

v0.1.5

Choose a tag to compare

@bruceamoser bruceamoser released this 25 Aug 22:33

What's Changed

  • Fix the DataModelValidationError: ownership is not a mapping of user IDs and document permission levels on Foundry v13/v14.

    Foundry v13/v14's Configure Ownership dialog now natively cascades folder ownership into contained documents, but it forwards the folder's meta-levels (-10 no-change / -20 default) as-is — which are not valid stored ownership levels on a document. This threw validation errors on every contained document even though the module's own cascade applied the correct (cleaned) permissions.

    The module now detects AppV2 (v13/v14), attaches its submit listener in the capture phase, and when the cascade checkbox is checked it:

    • preventDefault + stopImmediatePropagation so Foundry's buggy native recursion doesn't run
    • saves the folder's ownership with a cleaned, valid ownership mapping
    • cascades that same cleaned ownership to every contained document
    • closes the app (AppV2 closes on submit by default)

    Also switched to the namespaced foundry.applications.ux.FormDataExtended to remove the v13 deprecation warning.

    Verified live against Foundry 14.365: no validation errors, folder ownership saved, contained documents updated.

Compatibility

Foundry VTT Status
v11 Minimum
v12 Compatible
v13 Compatible
v14 Verified

v0.1.4

Choose a tag to compare

@bruceamoser bruceamoser released this 25 Aug 22:01

What's Changed

  • Fix the DataModelValidationError: ownership is not a mapping of user IDs and document permission levels that appeared when cascading folder ownership on Foundry v13/v14.
    • Parse the ownership form with FormDataExtended (the same path Foundry's own submit handler uses) so the nested ownership structure is exactly what Foundry expects, with a manual <select> fallback for older V1 forms.
    • Normalize ownership keys (dot + bracket notation), coerce all values to numbers, and drop non-concrete meta-levels (-1/-10/-20).
    • Always include a valid default level (falling back to the folder's stored default) when applying concrete user levels, so every contained document's merged ownership stays a valid mapping.
    • Clone the ownership object per document to avoid shared-reference mutation during Foundry's batch diffing.
    • If a batch update fails, retry per-document and log exactly which document/ownership failed, reporting a partial-success warning instead of a hard error.

Compatibility

Foundry VTT Status
v11 Minimum
v12 Compatible
v13 Compatible
v14 Verified

v0.1.3

Choose a tag to compare

@bruceamoser bruceamoser released this 25 Aug 21:33

What's Changed

  • Bundle README.md in the release package to keep the Foundry VTT listing current. Foundry renders the README from inside the module zip; previous releases omitted it, so the public page kept showing the original v0.1.0 README (v11–v13). The packaged zip now includes README.md, and the Foundry listing reflects the v11–v14 support and the fixed compatibility table.

Compatibility

Foundry VTT Status
v11 Minimum
v12 Compatible
v13 Compatible
v14 Verified

v0.1.2

Choose a tag to compare

@bruceamoser bruceamoser released this 25 Aug 21:28

What's Changed

  • Fix validation errors on Foundry v13+ — the Configure Ownership form's <select> fields are named with an ownership. prefix (e.g. ownership.default, ownership.<userId>). The module was copying those names directly as ownership keys, producing invalid keys and triggering DataModelValidationError: ownership is not a mapping of user IDs and document permission levels. Keys are now stripped of the prefix and validated (default or a numeric user ID), and non-concrete permission levels (inherit / no change) are skipped.

  • Foundry V14 compatibilitycompatibility.verified updated to 14 in module.json, the release workflow's Foundry package notification updated to report v14, and the README badges/compatibility table refreshed for v11–v14.

Compatibility

Foundry VTT Status
v11 Minimum
v12 Compatible
v13 Compatible
v14 Verified

v0.1.1

Choose a tag to compare

@bruceamoser bruceamoser released this 27 Feb 19:36

Test automated release pipeline

v0.1.0 — First Stable Release

Choose a tag to compare

@bruceamoser bruceamoser released this 17 Feb 02:46

Cascade Folder Permissions v0.1.0

First stable release.

Features

  • One-click cascade — adds "Apply to Sub-folders" checkbox to the Configure Ownership dialog for folders
  • Recursive — processes all sub-folders and their documents at any depth
  • Smart filtering — only applies concrete permission levels (None, Limited, Observer, Owner); "inherit / no change" values are skipped
  • Batch updates — uses DocumentClass.updateDocuments() for efficient server-side processing
  • V11–V13 compatible — handles both V1 and V2 Application frameworks
  • Localized — all UI strings use Foundry's i18n system (English included)
  • System agnostic — works with any game system

Installation

Paste this manifest URL into Install Module in Foundry:

https://github.com/bruceamoser/foundry-apply-permissions/releases/latest/download/module.json

Compatibility

Foundry VTT Status
v11 Minimum
v12 Compatible
v13 Verified

v0.0.7 - Fix ownership validation error

Choose a tag to compare

@bruceamoser bruceamoser released this 16 Feb 19:25
d609979

Bug: Foundry v13 V2 forms use -10 as the 'no change' sentinel in permission dropdowns. Our code only filtered -1 (the V1 'inherit' value), so -10 got passed through as an ownership level. Foundry rejected it: ownership: is not a mapping of user IDs and document permission levels.

Fix: Now only applies concrete permission levels (0=None, 1=Limited, 2=Observer, 3=Owner). Any other value (-1, -10, etc.) is skipped with a log message.

Also confirms v0.0.6 submit listener approach works - cascade now fires correctly on Foundry v13.

v0.0.6 - Fix V2 Application compatibility (Foundry v13)

Choose a tag to compare

@bruceamoser bruceamoser released this 16 Feb 19:21
d609979

Root cause: Foundry v13 migrated DocumentOwnershipConfig to a V2 Application. V2 apps do NOT use _updateObject — so our prototype wrapper was never called on save.

Fix: Removed _updateObject wrapping entirely. Now attaches a DOM submit event listener directly to the form element during the render hook. This works across V1 (v11/v12) and V2 (v13) Application frameworks.

What to look for in console (F12):

  • Attaching submit listener to form for folder: <name> on dialog open
  • Form submitted. cascade: true when saving with checkbox checked
  • Ownership form data: {...} showing the permission levels
  • Total documents to update: N showing cascade count

v0.0.5 – Cascade to documents, not folders

Choose a tag to compare

@bruceamoser bruceamoser released this 16 Feb 19:12
d609979

Key changes:

  • Now updates ownership on all documents (Items, JournalEntries, etc.) inside the target folder AND all sub-folders
  • No longer modifies folder ownership (folders auto-show when they contain visible content)
  • Fixed: previously skipped the target folder's own documents entirely
  • Fixed: early-returned when no sub-folders existed (flat folder with items got zero cascade)
  • Added verbose console logging — open F12 to see detailed output

What to look for in the console (F12):

  • 'Wrapping DocumentOwnershipConfig._updateObject' on world load
  • '_updateObject called, cascade: true' when saving
  • 'Total documents to update: N' showing the count

v0.0.4 – Fix cascade logic

Choose a tag to compare

@bruceamoser bruceamoser released this 16 Feb 19:07
d609979

Fixes:

  • Fixed cascade not processing sub-folder contents
  • Added fallback folder detection for v13 compatibility
  • Added console logging for debugging (open F12 dev tools to see)
  • More defensive error handling per sub-folder

Open the browser console (F12) in Foundry to see detailed logs when cascading.