Releases: bruceamoser/foundry-apply-permissions
Release list
v0.1.5
What's Changed
-
Fix the
DataModelValidationError: ownership is not a mapping of user IDs and document permission levelson 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 (
-10no-change /-20default) 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+stopImmediatePropagationso 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.FormDataExtendedto 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
What's Changed
- Fix the
DataModelValidationError: ownership is not a mapping of user IDs and document permission levelsthat 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 nestedownershipstructure 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
defaultlevel (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.
- Parse the ownership form with
Compatibility
| Foundry VTT | Status |
|---|---|
| v11 | Minimum |
| v12 | Compatible |
| v13 | Compatible |
| v14 | Verified |
v0.1.3
What's Changed
- Bundle
README.mdin 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 includesREADME.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
What's Changed
-
Fix validation errors on Foundry v13+ — the Configure Ownership form's
<select>fields are named with anownership.prefix (e.g.ownership.default,ownership.<userId>). The module was copying those names directly asownershipkeys, producing invalid keys and triggeringDataModelValidationError: ownership is not a mapping of user IDs and document permission levels. Keys are now stripped of the prefix and validated (defaultor a numeric user ID), and non-concrete permission levels (inherit / no change) are skipped. -
Foundry V14 compatibility —
compatibility.verifiedupdated to14inmodule.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
v0.1.0 — First Stable Release
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
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)
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 openForm submitted. cascade: truewhen saving with checkbox checkedOwnership form data: {...}showing the permission levelsTotal documents to update: Nshowing cascade count
v0.0.5 – Cascade to documents, not folders
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
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.