silverstripe /
silverstripe-restfulserver
| 1 | <?php |
||
| 2 | |||
| 3 | namespace SilverStripe\RestfulServer\Tests\Stubs; |
||
| 4 | |||
| 5 | use SilverStripe\Dev\TestOnly; |
||
| 6 | use SilverStripe\ORM\DataObject; |
||
| 7 | use SilverStripe\Security\Permission; |
||
| 8 | use SilverStripe\Security\PermissionProvider; |
||
| 9 | |||
| 10 | class RestfulServerTestSecretThing extends DataObject implements TestOnly, PermissionProvider |
||
| 11 | { |
||
| 12 | private static $api_access = true; |
||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
| 13 | |||
| 14 | private static $table_name = 'RestfulServerTestSecretThing'; |
||
|
0 ignored issues
–
show
|
|||
| 15 | |||
| 16 | private static $db = array( |
||
|
0 ignored issues
–
show
|
|||
| 17 | "Name" => "Varchar(255)", |
||
| 18 | ); |
||
| 19 | |||
| 20 | public function canView($member = null) |
||
| 21 | { |
||
| 22 | return Permission::checkMember($member, 'VIEW_SecretThing'); |
||
| 23 | } |
||
| 24 | |||
| 25 | public function providePermissions() |
||
| 26 | { |
||
| 27 | return array( |
||
| 28 | 'VIEW_SecretThing' => 'View Secret Things', |
||
| 29 | ); |
||
| 30 | } |
||
| 31 | } |
||
| 32 |