Code Duplication    Length = 52-54 lines in 4 locations

app/Containers/Authentication/UI/WEB/Requests/ViewDashboardRequest.php 1 location

@@ 12-65 (lines=54) @@
9
 *
10
 * @author Mahmoud Zalt <[email protected]>
11
 */
12
class ViewDashboardRequest extends Request
13
{
14
15
    /**
16
     * Define which Roles and/or Permissions has access to this request.
17
     *
18
     * @var  array
19
     */
20
    protected $access = [
21
        'roles'       => 'admin',
22
        'permissions' => '',
23
    ];
24
25
    /**
26
     * Id's that needs decoding before applying the validation rules.
27
     *
28
     * @var  array
29
     */
30
    protected $decode = [
31
32
    ];
33
34
    /**
35
     * Defining the URL parameters (`/stores/999/items`) allows applying
36
     * validation rules on them and allows accessing them like request data.
37
     *
38
     * @var  array
39
     */
40
    protected $urlParameters = [
41
42
    ];
43
44
    /**
45
     * Get the validation rules that apply to the request.
46
     *
47
     * @return array
48
     */
49
    public function rules()
50
    {
51
        return [];
52
    }
53
54
    /**
55
     * Determine if the user is authorized to make this request.
56
     *
57
     * @return bool
58
     */
59
    public function authorize()
60
    {
61
        return $this->check([
62
            'hasAccess',
63
        ]);
64
    }
65
}
66

app/Containers/Authorization/UI/API/Requests/ListAllPermissionsRequest.php 1 location

@@ 12-64 (lines=53) @@
9
 *
10
 * @author Mahmoud Zalt <[email protected]>
11
 */
12
class ListAllPermissionsRequest extends Request
13
{
14
15
    /**
16
     * Define which Roles and/or Permissions has access to this request.
17
     *
18
     * @var  array
19
     */
20
    protected $access = [
21
        'roles'       => 'admin',
22
        'permissions' => '',
23
    ];
24
25
    /**
26
     * Id's that needs decoding before applying the validation rules.
27
     *
28
     * @var  array
29
     */
30
    protected $decode = [
31
32
    ];
33
34
    /**
35
     * Defining the URL parameters (`/stores/999/items`) allows applying
36
     * validation rules on them and allows accessing them like request data.
37
     *
38
     * @var  array
39
     */
40
    protected $urlParameters = [
41
42
    ];
43
44
45
    /**
46
     * @return  array
47
     */
48
    public function rules()
49
    {
50
        return [
51
52
        ];
53
    }
54
55
    /**
56
     * @return  bool
57
     */
58
    public function authorize()
59
    {
60
        return $this->check([
61
            'hasAccess',
62
        ]);
63
    }
64
}
65

app/Containers/Authorization/UI/API/Requests/ListAllRolesRequest.php 1 location

@@ 12-63 (lines=52) @@
9
 *
10
 * @author Mahmoud Zalt <[email protected]>
11
 */
12
class ListAllRolesRequest extends Request
13
{
14
15
    /**
16
     * Define which Roles and/or Permissions has access to this request.
17
     *
18
     * @var  array
19
     */
20
    protected $access = [
21
        'roles' => 'admin',
22
        'permissions' => '',
23
    ];
24
25
    /**
26
     * Id's that needs decoding before applying the validation rules.
27
     *
28
     * @var  array
29
     */
30
    protected $decode = [
31
32
    ];
33
34
    /**
35
     * Defining the URL parameters (`/stores/999/items`) allows applying
36
     * validation rules on them and allows accessing them like request data.
37
     *
38
     * @var  array
39
     */
40
    protected $urlParameters = [
41
42
    ];
43
44
    /**
45
     * @return  array
46
     */
47
    public function rules()
48
    {
49
        return [
50
51
        ];
52
    }
53
54
    /**
55
     * @return  bool
56
     */
57
    public function authorize()
58
    {
59
        return $this->check([
60
            'hasAccess',
61
        ]);
62
    }
63
}
64

app/Containers/User/UI/API/Requests/ListAllUsersRequest.php 1 location

@@ 12-63 (lines=52) @@
9
 *
10
 * @author Mahmoud Zalt <[email protected]>
11
 */
12
class ListAllUsersRequest extends Request
13
{
14
15
    /**
16
     * Define which Roles and/or Permissions has access to this request.
17
     *
18
     * @var  array
19
     */
20
    protected $access = [
21
        'permissions' => 'list-users',
22
        'roles'       => 'admin',
23
    ];
24
25
    /**
26
     * Id's that needs decoding before applying the validation rules.
27
     *
28
     * @var  array
29
     */
30
    protected $decode = [
31
32
    ];
33
34
    /**
35
     * Defining the URL parameters (`/stores/999/items`) allows applying
36
     * validation rules on them and allows accessing them like request data.
37
     *
38
     * @var  array
39
     */
40
    protected $urlParameters = [
41
42
    ];
43
44
    /**
45
     * @return  array
46
     */
47
    public function rules()
48
    {
49
        return [
50
51
        ];
52
    }
53
54
    /**
55
     * @return  bool
56
     */
57
    public function authorize()
58
    {
59
        return $this->check([
60
            'hasAccess',
61
        ]);
62
    }
63
}
64