mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
Merge pull request #3 from flamerohr/pulls/fix-can-permissions
Add permission tests for editing fix
This commit is contained in:
commit
570157242e
@ -12,14 +12,18 @@ class EditableFormFieldTest extends FunctionalTest {
|
||||
$text = $this->objFromFixture('EditableTextField', 'basic-text');
|
||||
|
||||
$this->logInWithPermission('ADMIN');
|
||||
$this->assertTrue($text->canCreate());
|
||||
$this->assertTrue($text->canView());
|
||||
$this->assertTrue($text->canEdit());
|
||||
$this->assertTrue($text->canDelete());
|
||||
|
||||
$text->setReadonly(true);
|
||||
$this->assertTrue($text->canView());
|
||||
$this->assertFalse($text->canEdit());
|
||||
$this->assertFalse($text->canDelete());
|
||||
|
||||
$text->setReadonly(false);
|
||||
$this->assertTrue($text->canView());
|
||||
$this->assertTrue($text->canEdit());
|
||||
$this->assertTrue($text->canDelete());
|
||||
|
||||
@ -27,11 +31,15 @@ class EditableFormFieldTest extends FunctionalTest {
|
||||
$member->logout();
|
||||
|
||||
$this->logInWithPermission('SITETREE_VIEW_ALL');
|
||||
$this->assertFalse($text->canCreate());
|
||||
|
||||
$text->setReadonly(false);
|
||||
$this->assertTrue($text->canView());
|
||||
$this->assertFalse($text->canEdit());
|
||||
$this->assertFalse($text->canDelete());
|
||||
|
||||
$text->setReadonly(true);
|
||||
$this->assertTrue($text->canView());
|
||||
$this->assertFalse($text->canEdit());
|
||||
$this->assertFalse($text->canDelete());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user