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

RedisPermissions   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 8
lcom 0
cbo 1
dl 0
loc 42
ccs 16
cts 16
cp 1
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A canCreateItem() 0 4 1
A canEditItem() 0 4 1
A canDeleteItem() 0 4 1
A canCreateTable() 0 4 1
A canEditTable() 0 4 1
A canDeleteTable() 0 4 1
A canEditDatabase() 0 4 1
A canExecuteCommands() 0 4 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