mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX Enforcing canEdit() checks in ComplexTableField_Popup - making form readonly if the current user can't edit (from r110857)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112863 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
d8a8635374
commit
2d82ae6217
@ -1060,6 +1060,8 @@ class ComplexTableField_Popup extends Form {
|
|||||||
}
|
}
|
||||||
|
|
||||||
parent::__construct($controller, $name, $fields, $actions, $validator);
|
parent::__construct($controller, $name, $fields, $actions, $validator);
|
||||||
|
|
||||||
|
if(!$this->dataObject->canEdit()) $this->makeReadonly();
|
||||||
}
|
}
|
||||||
|
|
||||||
function forTemplate() {
|
function forTemplate() {
|
||||||
|
@ -38,6 +38,8 @@ class ComplexTableFieldTest extends FunctionalTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function testAddingManyManyNewPlayer() {
|
function testAddingManyManyNewPlayer() {
|
||||||
|
$this->logInWithPermission('ADMIN');
|
||||||
|
|
||||||
$team = DataObject::get_one('ComplexTableFieldTest_Team', "\"Name\" = 'The Awesome People'");
|
$team = DataObject::get_one('ComplexTableFieldTest_Team', "\"Name\" = 'The Awesome People'");
|
||||||
|
|
||||||
$this->post('ComplexTableFieldTest_Controller/ManyManyForm/field/Players/AddForm', array(
|
$this->post('ComplexTableFieldTest_Controller/ManyManyForm/field/Players/AddForm', array(
|
||||||
@ -57,6 +59,8 @@ class ComplexTableFieldTest extends FunctionalTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function testAddingHasManyData() {
|
function testAddingHasManyData() {
|
||||||
|
$this->logInWithPermission('ADMIN');
|
||||||
|
|
||||||
$team = DataObject::get_one('ComplexTableFieldTest_Team', "\"Name\" = 'The Awesome People'");
|
$team = DataObject::get_one('ComplexTableFieldTest_Team', "\"Name\" = 'The Awesome People'");
|
||||||
|
|
||||||
$this->post('ComplexTableFieldTest_Controller/HasManyForm/field/Sponsors/AddForm', array(
|
$this->post('ComplexTableFieldTest_Controller/HasManyForm/field/Sponsors/AddForm', array(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user