Completed
Push — master ( 4182b2...86604e )
by ARCANEDEV
12s
created

RouteViewerPolicy::listPolicy()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php namespace Arcanesoft\Foundation\Policies;
2
3
use Arcanesoft\Contracts\Auth\Models\User;
4
5
/**
6
 * Class     RouteViewerPolicy
7
 *
8
 * @package  Arcanesoft\Foundation\Policies
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class RouteViewerPolicy extends AbstractPolicy
12
{
13
    /* -----------------------------------------------------------------
14
     |  Constants
15
     | -----------------------------------------------------------------
16
     */
17
18
    const PERMISSION_LIST      = 'foundation.routeviewer.list';
19
20
    /* -----------------------------------------------------------------
21
     |  Abilities
22
     | -----------------------------------------------------------------
23
     */
24
25
    /**
26
     * Allow to list all the routes.
27
     *
28
     * @param  \Arcanesoft\Contracts\Auth\Models\User  $user
29
     *
30
     * @return bool
31
     */
32
    public function listPolicy(User $user)
33
    {
34
        return $user->may(static::PERMISSION_LIST);
35
    }
36
}
37