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: docs/4.Authorization.md
+11-6Lines changed: 11 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,19 @@
1
1
# Authorization
2
+
ZfcAdmin allows authorization via [BjyAuthorize](https://github.com/bjyoungblood/BjyAuthorize) or [ZfcRbac](https://github.com/ZF-Commons/ZfcRbac). Configuration for both modules is provided to easily configure ZfcAdmin. Authorization enables you to restrict access to `/admin` and every other page under ZfcAdmin.
2
3
3
-
Restrict access to unauthorized Users.
4
+
## BjyAuthorize authorization
5
+
BjyAuthorize works with `Zend\Permission\Acl` as access restriction component. The BjyAuthorize module combines `Zend\Permission\Acl` with the standard user module [ZfcUser](https://github/com/ZF-Commons/ZfcUser). To enable access restriction with BjyAuthorize, install the module and enable it in your `application.config.php`.
4
6
5
-
### Solution
7
+
Furthermore, ZfcAdmin has a `zfcadmin.global.php` file in the [config](../config/) directory. Copy this file over to your `config/autoload` directory. It directly provides BjyAuthorize configuration to restrict access to users for the `/admin` route. Only users in the "admin" group are allowed to access ZfcAdmin's pages.
6
8
7
-
1. Install BjyAuthorize and enable in you application.config.php
8
-
2. Import data/data.sql into your database.
9
-
3. Create a user with ZfcUser and set the user_id and role_id in the database
10
-
(e.g. user_id = 1, role_id = admin)
9
+
Instructions for further configuration of BjyAuthorize are provided in the [repository of BjyAuthorize](https://github.com/bjyoungblood/BjyAuthorize).
11
10
11
+
## ZfcRbac authorization
12
+
ZfcRbac works with `Zend\Permission\Rbac` as access restriction component. The ZfcRbac module combines `Zend\Permission\Rbac` with the standard user module [ZfcUser](https://github/com/ZF-Commons/ZfcUser). To enable access restriction with ZfcRbac, install the module and enable it in your `application.config.php`.
13
+
14
+
Furthermore, ZfcAdmin has a `zfcadmin.global.php` file in the [config](../config/) directory. Copy this file over to your `config/autoload` directory. It directly provides ZfcRbac configuration to restrict access to users for the `/admin` route. Only users in the "admin" group are allowed to access ZfcAdmin's pages.
15
+
16
+
Instructions for further configuration of ZfcRbac are provided in the [repository of ZfcRbac](https://github.com/ZF-Commons/ZfcRbac).
0 commit comments