-
Notifications
You must be signed in to change notification settings - Fork 823
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…-49783 [CVE-2023-49783] Allow permission checks in BulkLoader
- Loading branch information
Showing
11 changed files
with
260 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,19 @@ | ||
SilverStripe\Dev\Tests\CsvBulkLoaderTest\Team: | ||
team1: | ||
Title: My Team | ||
|
||
SilverStripe\Dev\Tests\CsvBulkLoaderTest\CantDeleteModel: | ||
model1: | ||
Title: Record 1 | ||
model2: | ||
Title: Record 2 | ||
model3: | ||
Title: Record 3 | ||
|
||
SilverStripe\Dev\Tests\CsvBulkLoaderTest\CantEditModel: | ||
model1: | ||
Title: Record 1 | ||
model2: | ||
Title: Record 2 | ||
model3: | ||
Title: Record 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace SilverStripe\Dev\Tests\CsvBulkLoaderTest; | ||
|
||
use SilverStripe\Dev\TestOnly; | ||
use SilverStripe\ORM\DataObject; | ||
|
||
class CanModifyModel extends DataObject implements TestOnly | ||
{ | ||
private static $table_name = 'CsvBulkLoaderTest_CanModifyModel'; | ||
|
||
private static array $db = [ | ||
'Title' => 'Varchar', | ||
'AnotherField' => 'Varchar', | ||
]; | ||
|
||
public function canCreate($member = null, $context = []) | ||
{ | ||
return true; | ||
} | ||
|
||
public function canEdit($member = null) | ||
{ | ||
return true; | ||
} | ||
|
||
public function canDelete($member = null) | ||
{ | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace SilverStripe\Dev\Tests\CsvBulkLoaderTest; | ||
|
||
use SilverStripe\Dev\TestOnly; | ||
|
||
class CantCreateModel extends CanModifyModel implements TestOnly | ||
{ | ||
public function canCreate($member = null, $context = []) | ||
{ | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace SilverStripe\Dev\Tests\CsvBulkLoaderTest; | ||
|
||
use SilverStripe\Dev\TestOnly; | ||
use SilverStripe\ORM\DataObject; | ||
|
||
class CantDeleteModel extends DataObject implements TestOnly | ||
{ | ||
private static $table_name = 'CsvBulkLoaderTest_CantDeleteModel'; | ||
|
||
private static array $db = [ | ||
'Title' => 'Varchar', | ||
'AnotherField' => 'Varchar', | ||
]; | ||
|
||
public function canCreate($member = null, $context = []) | ||
{ | ||
return true; | ||
} | ||
|
||
public function canEdit($member = null) | ||
{ | ||
return true; | ||
} | ||
|
||
public function canDelete($member = null) | ||
{ | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace SilverStripe\Dev\Tests\CsvBulkLoaderTest; | ||
|
||
use SilverStripe\Dev\TestOnly; | ||
|
||
class CantEditModel extends CanModifyModel implements TestOnly | ||
{ | ||
public function canEdit($member = null) | ||
{ | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Title, AnotherField | ||
Record 1, value 1 | ||
Record 2, value 2 | ||
Record 3, value 3 |