Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/module/applications/actor/actor-sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ export default class PbtaActorSheet extends foundry.appv1.sheets.ActorSheet {
await this._prepareAttrs(context);

for (let [k, v] of Object.entries(context.system.details)) {
// Descriptions marked `limited = true` are only meant to be seen by
// the actor's owner (e.g. a "Secrets" field), so hide them from
// anyone who only has Limited permission on this actor.
if (context.limited && v.limited) {
delete context.system.details[k];
continue;
}
context.system.details[k].enriched = await foundry.applications.ux.TextEditor.implementation.enrichHTML(v?.value ?? "", context.enrichmentOptions);
}

Expand Down
8 changes: 7 additions & 1 deletion src/module/data/actor/templates/actor.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ export class ActorDataTemplate extends foundry.abstract.TypeDataModel {
attrTop: new foundry.data.fields.ObjectField({ readonly: true }),
details: new MappingField(new foundry.data.fields.SchemaField({
label: new foundry.data.fields.StringField({ initial: "" }),
value: new foundry.data.fields.HTMLField({ initial: "" })
value: new foundry.data.fields.HTMLField({ initial: "" }),
// `attributes` is a plain ObjectField, so extra properties like
// `limited` survive untouched there. `details` uses a strict
// SchemaField instead, which silently drops any property not
// listed here — `limited` has to be declared explicitly or it
// never persists on the actor, regardless of what getData() checks.
limited: new foundry.data.fields.BooleanField({ initial: false })
}))
};
}
Expand Down