mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
Fix subsites to use correct permissions
See http://www.silverstripe.org/software/download/security-releases/ss-2015-008-sitetree-creation-permission-vulnerability Conflicts: tests/SiteTreeSubsitesTest.php
This commit is contained in:
parent
c18a0a266f
commit
bfc70f9b06
@ -9,6 +9,10 @@ class SiteTreeSubsitesTest extends BaseSubsiteTest {
|
||||
'SiteTreeSubsitesTest_ClassB'
|
||||
);
|
||||
|
||||
protected $illegalExtensions = array(
|
||||
'SiteTree' => array('Translatable')
|
||||
);
|
||||
|
||||
function testPagesInDifferentSubsitesCanShareURLSegment() {
|
||||
$subsiteMain = $this->objFromFixture('Subsite', 'main');
|
||||
$subsite1 = $this->objFromFixture('Subsite', 'subsite1');
|
||||
@ -178,16 +182,18 @@ class SiteTreeSubsitesTest extends BaseSubsiteTest {
|
||||
$s1->write();
|
||||
|
||||
Subsite::changeSubsite($s1);
|
||||
$classes = $cmsmain->PageTypes()->column('ClassName');
|
||||
$this->assertNotContains('ErrorPage', $classes);
|
||||
$this->assertNotContains('SiteTreeSubsitesTest_ClassA', $classes);
|
||||
$this->assertContains('SiteTreeSubsitesTest_ClassB', $classes);
|
||||
|
||||
Subsite::changeSubsite($s2);
|
||||
$classes = $cmsmain->PageTypes()->column("ClassName");
|
||||
$hints = Convert::json2array($cmsmain->SiteTreeHints());
|
||||
$classes = $hints['Root']['disallowedChildren'];
|
||||
$this->assertContains('ErrorPage', $classes);
|
||||
$this->assertContains('SiteTreeSubsitesTest_ClassA', $classes);
|
||||
$this->assertContains('SiteTreeSubsitesTest_ClassB', $classes);
|
||||
$this->assertNotContains('SiteTreeSubsitesTest_ClassB', $classes);
|
||||
|
||||
Subsite::changeSubsite($s2);
|
||||
$hints = Convert::json2array($cmsmain->SiteTreeHints());
|
||||
$classes = $hints['Root']['disallowedChildren'];
|
||||
$this->assertNotContains('ErrorPage', $classes);
|
||||
$this->assertNotContains('SiteTreeSubsitesTest_ClassA', $classes);
|
||||
$this->assertNotContains('SiteTreeSubsitesTest_ClassB', $classes);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user