Skip to content

Commit 3c445d6

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 916dd93 commit 3c445d6

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
@@ -556,8 +556,15 @@ public function testAdminFormUserUnauthorized(): void {
556556
$schema = self::validSchemaAllFields;
557557
$this->declarativeManager->registerSchema($app, $schema);
558558

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

563570
/**

0 commit comments

Comments
 (0)