Completed
Push — master ( 6d1120...3e38c4 )
by Michal
10s
created

MySqlPermissions   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 2
Bugs 1 Features 0
Metric Value
wmc 8
c 2
b 1
f 0
lcom 0
cbo 1
dl 0
loc 42
ccs 16
cts 16
cp 1
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A canCreateItem() 0 4 1
A canEditItem() 0 4 1
A canDeleteItem() 0 4 1
A canDeleteTable() 0 4 1
A canCreateDatabase() 0 4 1
A canEditDatabase() 0 4 1
A canDeleteDatabase() 0 4 1
A canExecuteCommands() 0 4 1
1
<?php
2
3
namespace UniMan\Drivers\MySql;
4
5
use UniMan\Core\Permissions\DefaultPermissions;
6
7
class MySqlPermissions extends DefaultPermissions
8
{
9 2
    public function canCreateItem($database, $type, $table)
10
    {
11 2
        return $database !== 'information_schema';
12
    }
13
14 2
    public function canEditItem($database, $type, $table, $item = null)
15
    {
16 2
        return $database !== 'information_schema';
17
    }
18
19 2
    public function canDeleteItem($database, $type, $table, $item)
20
    {
21 2
        return $database !== 'information_schema';
22
    }
23
24 2
    public function canDeleteTable($database, $type, $table)
25
    {
26 2
        return $database !== 'information_schema';
27
    }
28
29 2
    public function canCreateDatabase()
30
    {
31 2
        return true;
32
    }
33
34 2
    public function canEditDatabase($database)
35
    {
36 2
        return true;
37
    }
38
39 2
    public function canDeleteDatabase($database)
40
    {
41 2
        return $database !== 'information_schema';
42
    }
43
44 2
    public function canExecuteCommands()
45
    {
46 2
        return true;
47
    }
48
}
49