2017-11-29 03:20:09 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace SilverStripe\RestfulServer\Tests\Stubs;
|
|
|
|
|
|
|
|
use SilverStripe\Dev\TestOnly;
|
2018-02-08 04:56:21 +01:00
|
|
|
use SilverStripe\ORM\DataObject;
|
|
|
|
use SilverStripe\Security\Permission;
|
2017-11-29 03:20:09 +01:00
|
|
|
use SilverStripe\Security\PermissionProvider;
|
|
|
|
|
|
|
|
class RestfulServerTestSecretThing extends DataObject implements TestOnly, PermissionProvider
|
|
|
|
{
|
|
|
|
private static $api_access = true;
|
|
|
|
|
|
|
|
private static $table_name = 'RestfulServerTestSecretThing';
|
|
|
|
|
|
|
|
private static $db = array(
|
|
|
|
"Name" => "Varchar(255)",
|
|
|
|
);
|
|
|
|
|
|
|
|
public function canView($member = null)
|
|
|
|
{
|
|
|
|
return Permission::checkMember($member, 'VIEW_SecretThing');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function providePermissions()
|
|
|
|
{
|
|
|
|
return array(
|
|
|
|
'VIEW_SecretThing' => 'View Secret Things',
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|