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
{{ message }}
This repository was archived by the owner on Jul 3, 2020. It is now read-only.
Copy file name to clipboardExpand all lines: docs/02. Quick Start.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,17 +2,17 @@
2
2
3
3
In this section, you will learn:
4
4
5
-
* How to setup the module
5
+
* How to set up the module
6
6
* How to specify an identity provider
7
-
* How to add simple role provider
7
+
* How to add a simple role provider
8
8
9
9
Before starting the quick start, make sure you have properly installed the module by following the instructions in
10
10
the README file.
11
11
12
12
## Specifying an identity provider
13
13
14
14
By default, ZfcRbac internally uses the `Zend\Authentication\AuthenticationService` service key to retrieve the user (logged or
15
-
not). Therefore, you must implement and register this service in your application by adding those lines in your `module.config.php` file:
15
+
not). Therefore, you must implement and register this service in your application by adding these lines in your `module.config.php` file:
16
16
17
17
```php
18
18
return [
@@ -27,12 +27,12 @@ return [
27
27
```
28
28
The identity given by `Zend\Authentication\AuthenticationService` must implement `ZfcRbac\Identity\IdentityInterface`. Note that the default identity provided with ZF2 does not implement this interface, neither does the ZfcUser suite.
29
29
30
-
ZfcRbac is flexible enough to use something else than the built-in `AuthenticationService`, by specifying custom
30
+
ZfcRbac is flexible enough to use something other than the built-in `AuthenticationService`, by specifying custom
31
31
identity providers. For more information, refer [to this section](/docs/03. Role providers.md#identity-providers).
32
32
33
33
## Adding a guard
34
34
35
-
A guard allows to block access to routes and/or controllers using a simple syntax. For instance, this configuration
35
+
A guard allows your application to block access to routes and/or controllers using a simple syntax. For instance, this configuration
36
36
grants access to any route that begins with `admin` (or is exactly `admin`) to the `admin` role only:
37
37
38
38
```php
@@ -47,15 +47,15 @@ return [
47
47
];
48
48
```
49
49
50
-
ZfcRbac have several built-in guards, and you can also register your own guards. For more information, refer
50
+
ZfcRbac has several built-in guards, and you can also register your own guards. For more information, refer
51
51
[to this section](/docs/04. Guards.md#built-in-guards).
52
52
53
53
## Adding a role provider
54
54
55
55
RBAC model is based on roles. Therefore, for ZfcRbac to work properly, it must be aware of all the roles that are
56
56
used inside your application.
57
57
58
-
This configuration creates an *admin* role that has a children role called *member*. The *admin* role automatically
58
+
This configuration creates an *admin* role that has a child role called *member*. The *admin* role automatically
59
59
inherits the *member* permissions.
60
60
61
61
```php
@@ -76,10 +76,10 @@ return [
76
76
];
77
77
```
78
78
79
-
In this example, the *admin* role have two permissions: `delete` and `edit` (because it inherits the permissions from
80
-
its child), while the *member* role only has the permission `edit`.
79
+
In this example, the *admin* role has two permissions: `delete` and `edit` (because it inherits the permissions from
80
+
its child), while the *member* role only has the `edit` permission.
81
81
82
-
ZfcRbac have several built-in role providers, and you can also register your own role providers. For more information,
82
+
ZfcRbac has several built-in role providers, and you can also register your own role providers. For more information,
83
83
refer [to this section](/docs/03. Role providers.md#built-in-role-providers).
84
84
85
85
## Registering a strategy
@@ -101,16 +101,16 @@ public function onBootstrap(EventInterface $e)
101
101
}
102
102
```
103
103
104
-
By default, `RedirectStrategy` redirects all unauthorized requests to a route named "login" when user is not connected
105
-
and to a route named "home" when user is connected. This is, of course, entirely configurable.
104
+
By default, `RedirectStrategy` redirects all unauthorized requests to a route named "login" when the user is not connected
105
+
and to a route named "home" when the user is connected. This is, of course, entirely configurable.
106
106
107
-
> For flexibility purpose, ZfcRbac **does not** register any strategy for you by default!
107
+
> For flexibility purposes, ZfcRbac **does not** register any strategy for you by default!
108
108
109
109
For more information about built-in strategies, refer [to this section](/docs/05. Strategies.md#built-in-strategies).
110
110
111
111
## Using the authorization service
112
112
113
-
Now that ZfcRbac is properly configured, you can inject the authorization service in any class and use it to check
113
+
Now that ZfcRbac is properly configured, you can inject the authorization service into any class and use it to check
114
114
if the current identity is granted to do something.
115
115
116
116
The authorization service is registered inside the service manager using the following key: `ZfcRbac\Service\AuthorizationService`.
0 commit comments