Passed
Push — master ( 61cc62...67a7e6 )
by Iman
04:30
created

PrivilegeRepo::grantAllPermissions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 8
nc 1
nop 1
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace crocodicstudio\crudbooster\Modules\PrivilegeModule;
4
5
class PrivilegeRepo
6
{
7
    /**
8
     * @param $id
9
     */
10
    public function grantAllPermissions($id)
11
    {
12
        \DB::table('cms_privileges_roles')->insert([
13
            'id_cms_modules' => $id,
14
            'id_cms_privileges' => auth('cbAdmin')->user()->id_cms_privileges,
0 ignored issues
show
Bug introduced by
Accessing id_cms_privileges on the interface Illuminate\Contracts\Auth\Authenticatable suggest that you code against a concrete implementation. How about adding an instanceof check?
Loading history...
15
            'can_see_module' => 1,
16
            'can_create' => 1,
17
            'can_read' => 1,
18
            'can_edit' => 1,
19
            'can_delete' => 1,
20
        ]);
21
    }
22
}