Completed
Push — master ( 3e38c4...3f7c7b )
by Michal
02:49
created

RedisPermissions::canEditDatabase()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace UniMan\Drivers\Redis;
4
5
use UniMan\Core\Permissions\DefaultPermissions;
6
7
class RedisPermissions extends DefaultPermissions
8
{
9 2
    public function canCreateItem($database, $type, $table)
10
    {
11 2
        return true;
12
    }
13
14 2
    public function canEditItem($database, $type, $table, $item = null)
15
    {
16 2
        return true;
17
    }
18
19 2
    public function canDeleteItem($database, $type, $table, $item)
20
    {
21 2
        return true;
22
    }
23
24 2
    public function canCreateTable($database, $type)
25
    {
26 2
        return $type !== RedisDriver::TYPE_KEY;
27
    }
28
29 2
    public function canEditTable($database, $type, $table)
30
    {
31 2
        return $type !== RedisDriver::TYPE_KEY;
32
    }
33
34 2
    public function canDeleteTable($database, $type, $table)
35
    {
36 2
        return $type !== RedisDriver::TYPE_KEY;
37
    }
38
39 2
    public function canEditDatabase($database)
40
    {
41 2
        return true;
42
    }
43
44 2
    public function canExecuteCommands()
45
    {
46 2
        return true;
47
    }
48
}
49