Make it so that the actor can reject embedded items using the Item pre-create hook
This commit is contained in:
parent
1701547e57
commit
3791a7199c
4 changed files with 43 additions and 12 deletions
|
|
@ -39,4 +39,16 @@ export class ActorHandler extends Actor {
|
|||
if (!this.fn?.[`createCustom${data.embeddedCreate}`]) return;
|
||||
this.fn?.[`createCustom${data.embeddedCreate}`].bind(this)($event);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {ItemHandler} item
|
||||
* @returns {boolean} true to allow the document to be embedded
|
||||
*/
|
||||
async preItemEmbed(item) {
|
||||
let type = item.type[0].toUpperCase() + item.type.slice(1);
|
||||
if (this.fn?.[`pre${type}Embed`]) {
|
||||
return await this.fn?.[`pre${type}Embed`].bind(this)(item);
|
||||
};
|
||||
return true;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue