RouteViewerPolicy   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 3
dl 0
loc 24
ccs 0
cts 2
cp 0
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A listPolicy() 0 3 1
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