Passed
Push — master ( aa8632...8083b4 )
by Darko
16:30
created

ForumPolicy   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 7
eloc 7
c 2
b 1
f 0
dl 0
loc 38
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A moveCategories() 0 3 1
A __construct() 0 2 1
A viewTrashedPosts() 0 3 1
A createCategories() 0 3 1
A viewTrashedThreads() 0 3 1
A manageCategories() 0 3 1
A renameCategories() 0 3 1
1
<?php
2
3
namespace App\Policies;
4
5
class ForumPolicy extends \TeamTeaTime\Forum\Policies\ForumPolicy
6
{
7
    /**
8
     * Create a new policy instance.
9
     */
10
    public function __construct()
11
    {
12
        //
13
    }
14
15
    public function createCategories($user): bool
16
    {
17
        return $user->hasRole('Admin');
18
    }
19
20
    public function manageCategories($user): bool
21
    {
22
        return $user->hasRole('Admin');
23
    }
24
25
    public function moveCategories($user): bool
26
    {
27
        return $user->hasRole('Admin');
28
    }
29
30
    public function renameCategories($user): bool
31
    {
32
        return $user->hasRole('Admin');
33
    }
34
35
    public function viewTrashedThreads($user): bool
36
    {
37
        return $user->hasRole('Admin');
38
    }
39
40
    public function viewTrashedPosts($user): bool
41
    {
42
        return $user->hasRole('Admin');
43
    }
44
}
45