RestfulServerTestSecretThing   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A providePermissions() 0 4 1
A canView() 0 3 1
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
The private property $api_access is not used, and could be removed.
Loading history...
13
14
    private static $table_name = 'RestfulServerTestSecretThing';
0 ignored issues
show
introduced by
The private property $table_name is not used, and could be removed.
Loading history...
15
16
    private static $db = array(
0 ignored issues
show
introduced by
The private property $db is not used, and could be removed.
Loading history...
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