Completed
Push — develop-3.0 ( 4fe777...24fc5d )
by Mohamed
09:15
created

AdminAccess::before()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 3
nc 2
nop 1
1
<?php
2
3
/*
4
 * This file is part of the Tinyissue package.
5
 *
6
 * (c) Mohamed Alsharaf <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Tinyissue\Extensions\Policies;
13
14
use Tinyissue\Contracts\Model\UserInterface;
15
16
trait AdminAccess
17
{
18
    public function before($user)
19
    {
20
        if ($user instanceof UserInterface && $user->isAdmin()) {
21
            return true;
22
        }
23
    }
24
}
25