feat: lit/tb-create-template – disabled templates, all or nothing

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-27 16:09:49 +02:00
co-authored by Claude Opus 5.5
parent 54922a9f7e
commit 42b9b384d5
10 changed files with 1165 additions and 46 deletions
@@ -90,6 +90,22 @@ final class ThemeBuilderAccessTest extends TestCase
self::assertToolError(ThemeBuilderFixtures::access([], false)->template(1066, true), 'forbidden');
}
/** Ruling Q18: a template the user may not edit answers exactly like a missing one (like tb-list, Q8/B11). */
public function testATemplateTheUserMayNotEditReadsLikeAMissingOne(): void
{
LibraryFixtures::given([ThemeBuilderFixtures::templatePost()], ['edit_post']);
foreach ([false, true] as $forWrite) {
$hidden = ThemeBuilderFixtures::access()->template(ThemeBuilderFixtures::TEMPLATE, $forWrite);
$missing = ThemeBuilderFixtures::access()->template(1067, $forWrite);
self::assertToolError($hidden, 'not_found');
self::assertSame(
str_replace('1067', '1066', (string) json_encode(self::clientError($missing))),
(string) json_encode(self::clientError($hidden))
);
}
}
public function testCreatingNeedsPublishRightsAndTheGroup(): void
{
LibraryFixtures::given([]);