feat: lit-library-insert as copy or global instance in the builder's format (E5)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-27 02:27:16 +02:00
co-authored by Claude Opus 5.5
parent 5035092805
commit 7fe91c2bdb
9 changed files with 580 additions and 8 deletions
@@ -148,6 +148,16 @@ class LibraryAccess
return $this->roles->refusal('edit_global_library');
}
/**
* Inserting from the library into a page (E3): canList(), the role option add_library (Divi's
* "Aus der Bibliothek hinzufügen") and a group "Divi-Bibliothek" that is not read-only or
* disabled (E9). Reading the entry itself stays item() (ruling P5).
*/
public function canInsert(): ?WP_Error
{
return $this->canList() ?? $this->roles->refusal('add_library') ?? $this->writableGate();
}
/** Refusal while the Tools tab keeps this connection from writing to the library. */
public function writableGate(): ?WP_Error
{