2022-05-06 03:59:56 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace SilverStripe\FrameworkTest\Elemental\Model;
|
|
|
|
|
|
|
|
use SilverStripe\FrameworkTest\Elemental\Admin\ElementalBehatTestAdmin;
|
|
|
|
use SilverStripe\Control\Controller;
|
|
|
|
use SilverStripe\ORM\DataObject;
|
2022-08-29 06:53:53 +02:00
|
|
|
use SilverStripe\Security\Permission;
|
2022-05-06 03:59:56 +02:00
|
|
|
|
|
|
|
class ElementalBehatTestObject extends DataObject
|
|
|
|
{
|
2022-07-05 07:50:17 +02:00
|
|
|
private static $table_name = 'ElementalBehatTestObject';
|
2022-05-06 03:59:56 +02:00
|
|
|
|
|
|
|
public function CMSEditLink()
|
|
|
|
{
|
|
|
|
$admin = ElementalBehatTestAdmin::singleton();
|
|
|
|
$sanitisedClassname = str_replace('\\', '-', $this->ClassName);
|
|
|
|
|
|
|
|
return Controller::join_links(
|
|
|
|
$admin->Link($sanitisedClassname),
|
|
|
|
'EditForm/field/',
|
|
|
|
$sanitisedClassname,
|
|
|
|
'item',
|
|
|
|
$this->ID,
|
|
|
|
);
|
|
|
|
}
|
2022-08-29 06:53:53 +02:00
|
|
|
|
|
|
|
public function canView($member = null)
|
|
|
|
{
|
|
|
|
return Permission::check(ElementalBehatTestAdmin::getRequiredPermissions() , 'any', $member);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function canEdit($member = null)
|
|
|
|
{
|
|
|
|
return Permission::check(ElementalBehatTestAdmin::getRequiredPermissions(), 'any', $member);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function canDelete($member = null)
|
|
|
|
{
|
|
|
|
return Permission::check(ElementalBehatTestAdmin::getRequiredPermissions(), 'any', $member);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function canCreate($member = null, $context = [])
|
|
|
|
{
|
|
|
|
return Permission::check(ElementalBehatTestAdmin::getRequiredPermissions(), 'any', $member);
|
|
|
|
}
|
|
|
|
|
2022-05-06 03:59:56 +02:00
|
|
|
}
|