@@ 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 |
@@ 12-64 (lines=53) @@ | ||
9 | * |
|
10 | * @author Mahmoud Zalt <[email protected]> |
|
11 | */ |
|
12 | class GetAllPermissionsRequest 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' => '', |
|
22 | 'permissions' => 'manage-roles', |
|
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 |
@@ 12-63 (lines=52) @@ | ||
9 | * |
|
10 | * @author Mahmoud Zalt <[email protected]> |
|
11 | */ |
|
12 | class GetAllRolesRequest 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' => '', |
|
22 | 'permissions' => 'manage-roles', |
|
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 |
@@ 12-62 (lines=51) @@ | ||
9 | * |
|
10 | * @author Johannes Schobel <[email protected]> |
|
11 | */ |
|
12 | class GetAllLocalizationsRequest extends Request |
|
13 | { |
|
14 | /** |
|
15 | * Define which Roles and/or Permissions has access to this request. |
|
16 | * |
|
17 | * @var array |
|
18 | */ |
|
19 | protected $access = [ |
|
20 | 'permissions' => '', |
|
21 | 'roles' => '', |
|
22 | ]; |
|
23 | ||
24 | /** |
|
25 | * Id's that needs decoding before applying the validation rules. |
|
26 | * |
|
27 | * @var array |
|
28 | */ |
|
29 | protected $decode = [ |
|
30 | ||
31 | ]; |
|
32 | ||
33 | /** |
|
34 | * Defining the URL parameters (e.g, `/user/{id}`) allows applying |
|
35 | * validation rules on them and allows accessing them like request data. |
|
36 | * |
|
37 | * @var array |
|
38 | */ |
|
39 | protected $urlParameters = [ |
|
40 | ||
41 | ]; |
|
42 | ||
43 | /** |
|
44 | * @return array |
|
45 | */ |
|
46 | public function rules() |
|
47 | { |
|
48 | return [ |
|
49 | ||
50 | ]; |
|
51 | } |
|
52 | ||
53 | /** |
|
54 | * @return bool |
|
55 | */ |
|
56 | public function authorize() |
|
57 | { |
|
58 | return $this->check([ |
|
59 | 'hasAccess', |
|
60 | ]); |
|
61 | } |
|
62 | } |
|
63 |
@@ 13-64 (lines=52) @@ | ||
10 | * @author Johannes Schobel <[email protected]> |
|
11 | * @author Mahmoud Zalt <[email protected]> |
|
12 | */ |
|
13 | class GetAllPaymentAccountsRequest extends Request |
|
14 | { |
|
15 | /** |
|
16 | * Define which Roles and/or Permissions has access to this request. |
|
17 | * |
|
18 | * @var array |
|
19 | */ |
|
20 | protected $access = [ |
|
21 | 'permissions' => '', |
|
22 | 'roles' => '', |
|
23 | ]; |
|
24 | ||
25 | /** |
|
26 | * Id's that needs decoding before applying the validation rules. |
|
27 | * |
|
28 | * @var array |
|
29 | */ |
|
30 | protected $decode = [ |
|
31 | // 'id', |
|
32 | ]; |
|
33 | ||
34 | /** |
|
35 | * Defining the URL parameters (e.g, `/user/{id}`) allows applying |
|
36 | * validation rules on them and allows accessing them like request data. |
|
37 | * |
|
38 | * @var array |
|
39 | */ |
|
40 | protected $urlParameters = [ |
|
41 | //'id', |
|
42 | ]; |
|
43 | ||
44 | /** |
|
45 | * @return array |
|
46 | */ |
|
47 | public function rules() |
|
48 | { |
|
49 | return [ |
|
50 | // put your rules here |
|
51 | // 'name' => 'required|max:255' |
|
52 | ]; |
|
53 | } |
|
54 | ||
55 | /** |
|
56 | * @return bool |
|
57 | */ |
|
58 | public function authorize() |
|
59 | { |
|
60 | return $this->check([ |
|
61 | 'hasAccess', |
|
62 | ]); |
|
63 | } |
|
64 | } |
|
65 |
@@ 10-58 (lines=49) @@ | ||
7 | /** |
|
8 | * Class GetAllSettingsRequest. |
|
9 | */ |
|
10 | class GetAllSettingsRequest extends Request |
|
11 | { |
|
12 | /** |
|
13 | * Define which Roles and/or Permissions has access to this request. |
|
14 | * |
|
15 | * @var array |
|
16 | */ |
|
17 | protected $access = [ |
|
18 | 'permissions' => '', |
|
19 | 'roles' => 'admin', |
|
20 | ]; |
|
21 | ||
22 | /** |
|
23 | * Id's that needs decoding before applying the validation rules. |
|
24 | * |
|
25 | * @var array |
|
26 | */ |
|
27 | protected $decode = [ |
|
28 | ]; |
|
29 | ||
30 | /** |
|
31 | * Defining the URL parameters (e.g, `/user/{id}`) allows applying |
|
32 | * validation rules on them and allows accessing them like request data. |
|
33 | * |
|
34 | * @var array |
|
35 | */ |
|
36 | protected $urlParameters = [ |
|
37 | ]; |
|
38 | ||
39 | /** |
|
40 | * @return array |
|
41 | */ |
|
42 | public function rules() |
|
43 | { |
|
44 | return [ |
|
45 | // put your rules here |
|
46 | ]; |
|
47 | } |
|
48 | ||
49 | /** |
|
50 | * @return bool |
|
51 | */ |
|
52 | public function authorize() |
|
53 | { |
|
54 | return $this->check([ |
|
55 | 'hasAccess', |
|
56 | ]); |
|
57 | } |
|
58 | } |
|
59 |
@@ 12-63 (lines=52) @@ | ||
9 | * |
|
10 | * @author Mahmoud Zalt <[email protected]> |
|
11 | */ |
|
12 | class GetAllUsersRequest 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 |
@@ 10-61 (lines=52) @@ | ||
7 | /** |
|
8 | * Class GetAuthenticatedUserRequest. |
|
9 | */ |
|
10 | class GetAuthenticatedUserRequest extends Request |
|
11 | { |
|
12 | /** |
|
13 | * Define which Roles and/or Permissions has access to this request. |
|
14 | * |
|
15 | * @var array |
|
16 | */ |
|
17 | protected $access = [ |
|
18 | 'permissions' => '', |
|
19 | 'roles' => '', |
|
20 | ]; |
|
21 | ||
22 | /** |
|
23 | * Id's that needs decoding before applying the validation rules. |
|
24 | * |
|
25 | * @var array |
|
26 | */ |
|
27 | protected $decode = [ |
|
28 | // 'id', |
|
29 | ]; |
|
30 | ||
31 | /** |
|
32 | * Defining the URL parameters (e.g, `/user/{id}`) allows applying |
|
33 | * validation rules on them and allows accessing them like request data. |
|
34 | * |
|
35 | * @var array |
|
36 | */ |
|
37 | protected $urlParameters = [ |
|
38 | //'id', |
|
39 | ]; |
|
40 | ||
41 | /** |
|
42 | * @return array |
|
43 | */ |
|
44 | public function rules() |
|
45 | { |
|
46 | return [ |
|
47 | // put your rules here |
|
48 | // 'name' => 'required|max:255' |
|
49 | ]; |
|
50 | } |
|
51 | ||
52 | /** |
|
53 | * @return bool |
|
54 | */ |
|
55 | public function authorize() |
|
56 | { |
|
57 | return $this->check([ |
|
58 | 'hasAccess', |
|
59 | ]); |
|
60 | } |
|
61 | } |
|
62 |