Skip to content

Commit 432c541

Browse files
marcelklehrbackportbot[bot]
authored andcommitted
fix(DeclarativeManagerTest): Fix testAdminFormUserUnauthorized
Assisted-by: ClaudeCode:claude-opus-4-8 Signed-off-by: Marcel Klehr <mklehr@gmx.net>
1 parent a8dd30b commit 432c541

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

tests/lib/Settings/DeclarativeManagerTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,8 +555,15 @@ public function testAdminFormUserUnauthorized(): void {
555555
$schema = self::validSchemaAllFields;
556556
$this->declarativeManager->registerSchema($app, $schema);
557557

558+
// A non-admin user must not receive admin declarative forms, but this must not
559+
// throw: it would abort rendering of a section a user can legitimately access
560+
// through admin delegation (which only covers non-declarative settings).
561+
$forms = $this->declarativeManager->getFormsWithValues($this->user, $schema['section_type'], $schema['section_id']);
562+
$this->assertEmpty($forms);
563+
564+
// Writing to an admin declarative form is still forbidden for a non-admin user.
558565
$this->expectException(\Exception::class);
559-
$this->declarativeManager->getFormsWithValues($this->user, $schema['section_type'], $schema['section_id']);
566+
$this->declarativeManager->setValue($this->user, $app, $schema['id'], 'some_real_setting', '120m');
560567
}
561568

562569
/**

0 commit comments

Comments
 (0)