RestfulServerTestSecretThing::providePermissions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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