Skip to content
This repository has been archived by the owner on Jul 3, 2020. It is now read-only.

Commit

Permalink
Merge pull request #378 from DennisDobslaf/master
Browse files Browse the repository at this point in the history
Updated Markdown in /docs/*
  • Loading branch information
basz committed Mar 16, 2018
2 parents dd1857a + 3508efb commit 8a28d65
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 84 deletions.
6 changes: 3 additions & 3 deletions docs/01. Introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ can choose either of them independently.

To find out about how you can easily make your existing application more secure, please refer to the following section:

* [Cookbook: A real world example](/docs/07. Cookbook.md#a-real-world-application)
* [Cookbook: A real world example](07.%20Cookbook.md#a-real-world-application)

### Navigation

* Continue to [the **Quick Start**](/docs/02. Quick Start.md)
* Back to [the Index](/docs/README.md)
* Continue to [the **Quick Start**](02.%20Quick%20Start.md)
* Back to [the Index](README.md)
14 changes: 7 additions & 7 deletions docs/02. Quick Start.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ return [
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.

ZfcRbac is flexible enough to use something other than the built-in `AuthenticationService`, by specifying custom
identity providers. For more information, refer [to this section](/docs/03. Role providers.md#identity-providers).
identity providers. For more information, refer [to this section](03.%20Role%20providers.md#identity-providers).

## Adding a guard

Expand All @@ -48,7 +48,7 @@ return [
```

ZfcRbac has several built-in guards, and you can also register your own guards. For more information, refer
[to this section](/docs/04. Guards.md#built-in-guards).
[to this section](04.%20Guards.md#built-in-guards).

## Adding a role provider

Expand Down Expand Up @@ -80,7 +80,7 @@ In this example, the *admin* role has two permissions: `delete` and `edit` (beca
its child), while the *member* role only has the `edit` permission.

ZfcRbac has several built-in role providers, and you can also register your own role providers. For more information,
refer [to this section](/docs/03. Role providers.md#built-in-role-providers).
refer [to this section](03.%20Role%20providers.md#built-in-role-providers).

## Registering a strategy

Expand All @@ -106,7 +106,7 @@ and to a route named "home" when the user is connected. This is, of course, enti

> For flexibility purposes, ZfcRbac **does not** register any strategy for you by default!
For more information about built-in strategies, refer [to this section](/docs/05. Strategies.md#built-in-strategies).
For more information about built-in strategies, refer [to this section](05.%20Strategies.md#built-in-strategies).

## Using the authorization service

Expand All @@ -131,6 +131,6 @@ public function delete()

### Navigation

* Continue to [the **Role providers**](/docs/03. Role providers.md)
* Back to [the Introduction](/docs/01. Introduction.md)
* Back to [the Index](/docs/README.md)
* Continue to [the **Role providers**](03.%20Role%20providers.md)
* Back to [the Introduction](01.%20Introduction.md)
* Back to [the Index](README.md)
6 changes: 3 additions & 3 deletions docs/03. Role providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,6 @@ return [

### Navigation

* Continue to [the **Guards**](/docs/04. Guards.md)
* Back to [the Quick Start](/docs/02. Quick Start.md)
* Back to [the Index](/docs/README.md)
* Continue to [the **Guards**](04.%20Guards.md)
* Back to [the Quick Start](02.%20Quick%20Start.md)
* Back to [the Index](README.md)
10 changes: 5 additions & 5 deletions docs/04. Guards.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ the MVC workflow. They allow your application to quickly mark a request as unaut

Here is a simple workflow without guards:

![Zend Framework workflow without guards](/docs/images/workflow-without-guards.png?raw=true)
![Zend Framework workflow without guards](images/workflow-without-guards.png?raw=true)

And here is a simple workflow with a route guard:

![Zend Framework workflow with guards](/docs/images/workflow-with-guards.png?raw=true)
![Zend Framework workflow with guards](images/workflow-with-guards.png?raw=true)

RouteGuard and ControllerGuard are not aware of permissions but rather only think about "roles". For
instance, you may want to refuse access to each routes that begin by "admin/*" to all users that do not have the
Expand Down Expand Up @@ -487,6 +487,6 @@ return [

### Navigation

* Continue to [the **Strategies**](/docs/05. Strategies.md)
* Back to [the Role providers](/docs/03. Role providers.md)
* Back to [the Index](/docs/README.md)
* Continue to [the **Strategies**](05.%20Strategies.md)
* Back to [the Role providers](03.%20Role%20providers.md)
* Back to [the Index](README.md)
6 changes: 3 additions & 3 deletions docs/05. Strategies.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,6 @@ public function onBootstrap(EventInterface $e)

### Navigation

* Continue to [the **Authorization Service**](/docs/06. Using the Authorization Service.md)
* Back to [the Guards](/docs/04. Guards.md)
* Back to [the Index](/docs/README.md)
* Continue to [the **Authorization Service**](06.%20Using%20the%20Authorization%20Service.md)
* Back to [the Guards](04.%20Guards.md)
* Back to [the Index](README.md)
10 changes: 5 additions & 5 deletions docs/06. Using the Authorization Service.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ provided by the assertion map.

ZfcRbac comes with both a controller plugin and a view helper to check permissions.

In a controller :
#### In a controller :

```php
public function doSomethingAction()
Expand All @@ -215,7 +215,7 @@ In a controller :
}
```

In a view :
#### In a view :

```php
<?php if ($this->isGranted('myPermission')): ?>
Expand Down Expand Up @@ -271,6 +271,6 @@ $authorizationService->isGranted('myPermission', $context);

### Navigation

* Continue to [the **Cookbook**](/docs/07. Cookbook.md)
* Back to [the Strategies](/docs/05. Strategies.md)
* Back to [the Index](/docs/README.md)
* Continue to [the **Cookbook**](07.%20Cookbook.md)
* Back to [the Strategies](05.%20Strategies.md)
* Back to [the Index](README.md)
25 changes: 12 additions & 13 deletions docs/07. Cookbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@
This section will help you further understand how ZfcRbac works by providing more concrete examples. If you have
any other recipe you'd like to add, please open an issue!

- [A Real World Application](/docs/07.%20Cookbook.md#a-real-world-application)
- [Best Practices](https://github.com/manuakasam/zfc-rbac/blob/master/docs/07.%20Cookbook.md#best-practices)
- [When to use Guards](/docs/07.%20Cookbook.md#when-using-guards-then)
- [A Real World Application Part 2 - Only delete your own Posts](/docs/07.%20Cookbook.md#a-real-world-application-part-2---only-delete-your-own-posts)
- [A Real World Application Part 3 - But Admins can delete everything](/docs/07.%20Cookbook.md#a-real-world-application-part-3---admins-can-delete-everything)
- [A Real World Application Part 4 - Only admins have the menu item for managing the posts]
(/docs/07.%20Cookbook.md#a-real-world-application-part-4---checking-permissions-in-the-view)
- [Using ZfcRbac with Doctrine ORM](/docs/07.%20Cookbook.md#using-zfcrbac-with-doctrine-orm)
- [How to deal with roles with lot of permissions?](/docs/07.%20Cookbook.md#how-to-deal-with-roles-with-lot-of-permissions)
- [Using ZfcRbac and ZF2 Assetic](/docs/07.%20Cookbook.md#using-zfcrbac-and-zf2-assetic)
- [Using ZfcRbac and ZfcUser](/docs/07.%20Cookbook.md#using-zfcrbac-and-zfcuser)
- [A Real World Application](07.%20Cookbook.md#a-real-world-application)
- [Best Practices](https://github.com/manuakasam/zfc-rbac/blob/master07.%20Cookbook.md#best-practices)
- [When to use Guards](07.%20Cookbook.md#when-using-guards-then)
- [A Real World Application Part 2 - Only delete your own Posts](07.%20Cookbook.md#a-real-world-application-part-2---only-delete-your-own-posts)
- [A Real World Application Part 3 - But Admins can delete everything](07.%20Cookbook.md#a-real-world-application-part-3---admins-can-delete-everything)
- [A Real World Application Part 4 - Only admins have the menu item for managing the posts](07.%20Cookbook.md#user-content-a-real-world-application-part-4---checking-permissions-in-the-view)
- [Using ZfcRbac with Doctrine ORM](07.%20Cookbook.md#using-zfcrbac-with-doctrine-orm)
- [How to deal with roles with lot of permissions?](07.%20Cookbook.md#how-to-deal-with-roles-with-lot-of-permissions)
- [Using ZfcRbac and ZF2 Assetic](07.%20Cookbook.md#using-zfcrbac-and-zf2-assetic)
- [Using ZfcRbac and ZfcUser](07.%20Cookbook.md#using-zfcrbac-and-zfcuser)

## A Real World Application

Expand Down Expand Up @@ -777,5 +776,5 @@ return [

### Navigation

* Back to [the Using the Authorization Service](/docs/06. Using the Authorization Service.md)
* Back to [the Index](/docs/README.md)
* Back to [the Using the Authorization Service](06.%20Using%20the%20Authorization%20Service.md)
* Back to [the Index](README.md)
88 changes: 43 additions & 45 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,48 +5,46 @@ and extend ZfcRbac.

If you are looking for some information that is not listed in the documentation, please open an issue!

1. [Introduction](/docs/01. Introduction.md)
1. [Why should I use an authorization module?](/docs/01. Introduction.md#why-should-i-use-an-authorization-module)
2. [What is the Rbac model?](/docs/01. Introduction.md#what-is-the-rbac-model)
3. [How can I integrate ZfcRbac into my application?](/docs/01. Introduction.md#how-can-i-integrate-zfcrbac-into-my-application)

2. [Quick Start](/docs/02. Quick Start.md)
1. [Specifying an identity provider](/docs/02. Quick Start.md#specifying-an-identity-provider)
2. [Adding a guard](/docs/02. Quick Start.md#adding-a-guard)
3. [Adding a role provider](/docs/02. Quick Start.md#adding-a-role-provider)
5. [Registering a strategy](/docs/02. Quick Start.md#registering-a-strategy)
6. [Using the authorization service](/docs/02. Quick Start.md#using-the-authorization-service)

3. [Role providers](/docs/03. Role providers.md)
1. [What are role providers?](/docs/03. Role providers.md#what-are-role-providers)
2. [Identity providers](/docs/03. Role providers.md#identity-providers)
3. [Built-in role providers](/docs/03. Role providers.md#built-in-role-providers)
4. [Creating custom role providers](/docs/03. Role providers.md#creating-custom-role-providers)

4. [Guards](/docs/04. Guards.md)
1. [What are guards and when to use them?](/docs/04. Guards.md#what-are-guards-and-when-to-use-them)
2. [Built-in guards](/docs/04. Guards.md#built-in-guards)
3. [Creating custom guards](/docs/04. Guards.md#creating-custom-guards)

5. [Strategies](/docs/05. Strategies.md)
1. [What are strategies?](/docs/05. Strategies.md#what-are-strategies)
2. [Built-in strategies](/docs/05. Strategies.md#built-in-strategies)
3. [Creating custom strategies](/docs/05. Strategies.md#creating-custom-strategies)

6. [Using the Authorization Service](/docs/06. Using the Authorization Service.md)
1. [Injecting the AuthorizationService](/docs/06. Using the Authorization Service.md#injecting-the-authorization-service)
2. [Checking permissions](/docs/06. Using the Authorization Service.md#checking-permissions-in-a-service)
1. [In a service](/docs/06. Using the Authorization Service.md#checking-permissions-in-a-service)
2. [In a controller's action using the isGranted controller pluign]
(/docs/06. Using the Authorization Service.md#checking-permissions-in-a-controller-or-in-a-view)
3. [In a view using the isGranted view helper]
(/docs/06. Using the Authorization Service.md#checking-permissions-in-a-a-controller-or-in-a-view)
3. [Permissions and Assertions](/docs/06. Using the Authorization Service.md#permissions-and-assertions)

7. [Cookbook](/docs/07. Cookbook.md)
1. [A real world example](/docs/07. Cookbook.md#a-real-world-application)
2. [Best practices](/docs/07. Cookbook.md#best-practices)
3. [Using ZfcRbac with Doctrine ORM](/docs/07. Cookbook.md#using-zfcrbac-with-doctrine-orm)
4. [How to deal with roles with lot of permissions?](/docs/07. Cookbook.md#how-to-deal-with-roles-with-lot-of-permissions)
5. [Using ZfcRbac and ZF2 Assetic](/docs/07. Cookbook.md#using-zfcrbac-and-zf2-assetic)
6. [Using ZfcRbac and ZfcUser](/docs/07. Cookbook.md#using-zfcrbac-and-zfcuser)
1. [Introduction](01.%20Introduction.md)
1. [Why should I use an authorization module?](01.%20Introduction.md#why-should-i-use-an-authorization-module)
2. [What is the Rbac model?](01.%20Introduction.md#what-is-the-rbac-model)
3. [How can I integrate ZfcRbac into my application?](01.%20Introduction.md#how-can-i-integrate-zfcrbac-into-my-application)

2. [Quick Start](02.%20Quick%20Start.md)
1. [Specifying an identity provider](02.%20Quick%20Start.md#specifying-an-identity-provider)
2. [Adding a guard](02.%20Quick%20Start.md#adding-a-guard)
3. [Adding a role provider](02.%20Quick%20Start.md#adding-a-role-provider)
5. [Registering a strategy](02.%20Quick%20Start.md#registering-a-strategy)
6. [Using the authorization service](02.%20Quick%20Start.md#using-the-authorization-service)

3. [Role providers](03.%20Role%20providers.md)
1. [What are role providers?](03.%20Role%20providers.md#what-are-role-providers)
2. [Identity providers](03.%20Role%20providers.md#identity-providers)
3. [Built-in role providers](03.%20Role%20providers.md#built-in-role-providers)
4. [Creating custom role providers](03.%20Role%20providers.md#creating-custom-role-providers)

4. [Guards](04.%20Guards.md)
1. [What are guards and when to use them?](04.%20Guards.md#what-are-guards-and-when-to-use-them)
2. [Built-in guards](04.%20Guards.md#built-in-guards)
3. [Creating custom guards](04.%20Guards.md#creating-custom-guards)

5. [Strategies](05.%20Strategies.md)
1. [What are strategies?](05.%20Strategies.md#what-are-strategies)
2. [Built-in strategies](05.%20Strategies.md#built-in-strategies)
3. [Creating custom strategies](05.%20Strategies.md#creating-custom-strategies)

6. [Using the Authorization Service](06.%20Using%20the%20Authorization%20Service.md)
1. [Injecting the AuthorizationService](06.%20Using%20the%20Authorization%20Service.md#injecting-the-authorization-service)
2. [Checking permissions](06.%20Using%20the%20Authorization%20Service.md#checking-permissions-in-a-service)
1. [In a service](06.%20Using%20the%20Authorization%20Service.md#checking-permissions-in-a-service)
2. [In a controller's action using the isGranted controller plugin](06.%20Using%20the%20Authorization%20Service.md#in-a-controller-)
3. [In a view using the isGranted view helper](06.%20Using%20the%20Authorization%20Service.md#in-a-view-)
3. [Permissions and Assertions](06.%20Using%20the%20Authorization%20Service.md#permissions-and-assertions)

7. [Cookbook](07.%20Cookbook.md)
1. [A real world example](07.%20Cookbook.md#a-real-world-application)
2. [Best practices](07.%20Cookbook.md#best-practices)
3. [Using ZfcRbac with Doctrine ORM](07.%20Cookbook.md#using-zfcrbac-with-doctrine-orm)
4. [How to deal with roles with lot of permissions?](07.%20Cookbook.md#how-to-deal-with-roles-with-lot-of-permissions)
5. [Using ZfcRbac and ZF2 Assetic](07.%20Cookbook.md#using-zfcrbac-and-zf2-assetic)
6. [Using ZfcRbac and ZfcUser](07.%20Cookbook.md#using-zfcrbac-and-zfcuser)

0 comments on commit 8a28d65

Please sign in to comment.