You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-14Lines changed: 20 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# dot-rbac-guard
2
2
3
-
Defines authorization guards that authorize users for accessing certain parts of an application based on various criteria.
3
+
Defines authorization guards that authorize users to access certain parts of an application based on various criteria.
4
4
If the authorization service can be used to check authorization on a narrow level, the guards are meant to work as gateways to bigger parts of an application.
5
5
Usually, you'll want to use both methods in an application for increased security.
6
6
@@ -11,7 +11,7 @@ Documentation is available at: https://docs.dotkernel.org/dot-rbac-guard/.
@@ -36,7 +36,7 @@ You'll have to first configure dot-rbac before using this module.
36
36
37
37
## Configuration
38
38
39
-
As with many Dotkernel modules, we focus on the configurationbased approach of customizing the module for your needs.
39
+
As with many Dotkernel modules, we focus on the configuration-based approach of customizing the module for your needs.
40
40
41
41
After installing, merge the module's `ConfigProvider` with your application's config to make sure required dependencies and default module configuration are registered.
42
42
Create a configuration file for this module in your 'config/autoload' folder.
@@ -63,8 +63,8 @@ return [
63
63
//register custom guards providers here
64
64
'guards_provider_manager' => [],
65
65
66
-
//define which guards provider to use, along with its configuration
67
-
//the guards provider should know how to build a list of GuardInterfaces based on its configuration
66
+
//define which guard provider to use, along with its configuration
67
+
//the guard provider should know how to build a list of GuardInterfaces based on its configuration
68
68
'guards_provider' => [
69
69
'type' => 'ArrayGuards',
70
70
'options' => [
@@ -97,9 +97,11 @@ return [
97
97
'rules' => [
98
98
[
99
99
'route' => 'controller route name',
100
-
'actions' => [//list of actions to apply, or empty array for all actions],
101
-
//by default, authorization pass if all permissions are present(AND)
102
-
'roles' => [//list of roles to allow],
100
+
//list of actions to apply, or empty array for all actions
101
+
'actions' => [],
102
+
//by default, authorization pass if all permissions are present (AND)
103
+
//list of roles to allow
104
+
'roles' => [],
103
105
],
104
106
]
105
107
]
@@ -110,16 +112,20 @@ return [
110
112
'rules' => [
111
113
[
112
114
'route' => 'controller route name',
113
-
'actions' => [//list of actions to apply, or empty array for all actions],
114
-
//by default, authorization pass if all permissions are present(AND)
115
-
'permissions' => [//list of permissions to allow],
115
+
//list of actions to apply, or empty array for all actions
116
+
'actions' => [],
117
+
//by default, authorization pass if all permissions are present (AND)
118
+
//list of permissions to allow
119
+
'permissions' => [],
116
120
],
117
121
[
118
122
'route' => 'controller route name',
119
-
'actions' => [//list of actions to apply, or empty array for all actions],
123
+
//list of actions to apply, or empty array for all actions
124
+
'actions' => [],
120
125
'permissions' => [
121
126
//permission can be defined in this way too, for all permission type guards
The last step in order to use this package is to register the middleware.
152
+
The last step to use this package is to register the middleware.
147
153
This middleware triggers the authorization event.
148
154
You MUST insert this middleware between the routing middleware and the dispatch middleware of the application, because the guards need the `RouteResult` in order to get the matched route and params.
Copy file name to clipboardExpand all lines: docs/book/v3/configuration.md
+17-11Lines changed: 17 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Configuration
2
2
3
-
As with many Dotkernel modules, we focus on the configurationbased approach of customizing the module for your needs.
3
+
As with many Dotkernel modules, we focus on the configuration-based approach of customizing the module for your needs.
4
4
5
5
After installing, merge the module's `ConfigProvider` with your application's config to make sure required dependencies and default module configuration are registered.
6
6
Create a configuration file for this module in your 'config/autoload' folder.
@@ -27,8 +27,8 @@ return [
27
27
//register custom guards providers here
28
28
'guards_provider_manager' => [],
29
29
30
-
//define which guards provider to use, along with its configuration
31
-
//the guards provider should know how to build a list of GuardInterfaces based on its configuration
30
+
//define which guard provider to use, along with its configuration
31
+
//the guard provider should know how to build a list of GuardInterfaces based on its configuration
32
32
'guards_provider' => [
33
33
'type' => 'ArrayGuards',
34
34
'options' => [
@@ -61,9 +61,11 @@ return [
61
61
'rules' => [
62
62
[
63
63
'route' => 'controller route name',
64
-
'actions' => [//list of actions to apply, or empty array for all actions],
65
-
//by default, authorization pass if all permissions are present(AND)
66
-
'roles' => [//list of roles to allow],
64
+
//list of actions to apply, or empty array for all actions
65
+
'actions' => [],
66
+
//by default, authorization pass if all permissions are present (AND)
67
+
//list of roles to allow
68
+
'roles' => [],
67
69
],
68
70
]
69
71
]
@@ -74,16 +76,20 @@ return [
74
76
'rules' => [
75
77
[
76
78
'route' => 'controller route name',
77
-
'actions' => [//list of actions to apply, or empty array for all actions],
78
-
//by default, authorization pass if all permissions are present(AND)
79
-
'permissions' => [//list of permissions to allow],
79
+
//list of actions to apply, or empty array for all actions
80
+
'actions' => [],
81
+
//by default, authorization pass if all permissions are present (AND)
82
+
//list of permissions to allow
83
+
'permissions' => [],
80
84
],
81
85
[
82
86
'route' => 'controller route name',
83
-
'actions' => [//list of actions to apply, or empty array for all actions],
87
+
//list of actions to apply, or empty array for all actions
88
+
'actions' => [],
84
89
'permissions' => [
85
90
//permission can be defined in this way too, for all permission type guards
Copy file name to clipboardExpand all lines: docs/book/v4/configuration.md
+17-11Lines changed: 17 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Configuration
2
2
3
-
As with many Dotkernel modules, we focus on the configurationbased approach of customizing the module for your needs.
3
+
As with many Dotkernel modules, we focus on the configuration-based approach of customizing the module for your needs.
4
4
5
5
After installing, merge the module's `ConfigProvider` with your application's config to make sure required dependencies and default module configuration are registered.
6
6
Create a configuration file for this module in your 'config/autoload' folder.
@@ -27,8 +27,8 @@ return [
27
27
//register custom guards providers here
28
28
'guards_provider_manager' => [],
29
29
30
-
//define which guards provider to use, along with its configuration
31
-
//the guards provider should know how to build a list of GuardInterfaces based on its configuration
30
+
//define which guard provider to use, along with its configuration
31
+
//the guard provider should know how to build a list of GuardInterfaces based on its configuration
32
32
'guards_provider' => [
33
33
'type' => 'ArrayGuards',
34
34
'options' => [
@@ -61,9 +61,11 @@ return [
61
61
'rules' => [
62
62
[
63
63
'route' => 'controller route name',
64
-
'actions' => [//list of actions to apply, or empty array for all actions],
65
-
//by default, authorization pass if all permissions are present(AND)
66
-
'roles' => [//list of roles to allow],
64
+
//list of actions to apply, or empty array for all actions
65
+
'actions' => [],
66
+
//by default, authorization pass if all permissions are present (AND)
67
+
//list of roles to allow
68
+
'roles' => [],
67
69
],
68
70
]
69
71
]
@@ -74,16 +76,20 @@ return [
74
76
'rules' => [
75
77
[
76
78
'route' => 'controller route name',
77
-
'actions' => [//list of actions to apply, or empty array for all actions],
78
-
//by default, authorization pass if all permissions are present(AND)
79
-
'permissions' => [//list of permissions to allow],
79
+
//list of actions to apply, or empty array for all actions
80
+
'actions' => [],
81
+
//by default, authorization pass if all permissions are present (AND)
82
+
//list of permissions to allow
83
+
'permissions' => [],
80
84
],
81
85
[
82
86
'route' => 'controller route name',
83
-
'actions' => [//list of actions to apply, or empty array for all actions],
87
+
//list of actions to apply, or empty array for all actions
88
+
'actions' => [],
84
89
'permissions' => [
85
90
//permission can be defined in this way too, for all permission type guards
Copy file name to clipboardExpand all lines: docs/book/v4/updating-pipeline.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Register the RbacGuardMiddleware in the pipeline
2
2
3
-
The last step in order to use this package is to register the middleware.
3
+
The last step to use this package is to register the middleware.
4
4
This middleware triggers the authorization event.
5
5
You MUST insert this middleware between the routing middleware and the dispatch middleware of the application, because the guards need the `RouteResult` in order to get the matched route and params.
0 commit comments