Skip to content

Commit

Permalink
docs: formatting and whitespace changes
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Weier O'Phinney <[email protected]>
  • Loading branch information
weierophinney committed Sep 17, 2020
1 parent fb13cd1 commit 3a81215
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions docs/book/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ before the "guest" role, the example code would print "allowed".

### LIFO order for Role parents

When specifying multiple parents for a role the last parent listed is the first
one searched for rules applicable to an authorization query. This Last-In-First-Out (LIFO) strategy is represented with this example.
Here the `first` role inherits from `second`, `third`, and `last` and is the most permissioned role:
When specifying multiple parents for a role the last parent listed is the first one searched for rules applicable to an authorization query.
This Last-In-First-Out (LIFO) strategy is represented with this example.
Here the `first` role inherits from `second`, `third`, and `last`, and is the most permissioned role:

```php
use Zend\Permissions\Acl\Acl;
Expand All @@ -131,13 +131,16 @@ $acl->allow('third', 'someResource');
echo $acl->isAllowed('first', 'someResource') ? 'allowed' : 'denied';
```

Less-permissioned roles will be first in the parents array. For instance, where a`guest`
role is unauthenticated, a `user` role is authenticated, and an `admin` role has the highest
permissions. As soon as any ACL query returns false evaluation of `isAllowed` is terminated and false is returned. For this reason your least permissioned roles come first in the parents array. Adding the `admin` role is as follows:
Less-permissioned roles will be first in the parents array.
For instance, where a`guest` role is unauthenticated, a `user` role is authenticated, and an `admin` role has the highest permissions.
As soon as any ACL query returns false evaluation of `isAllowed` is terminated and false is returned.
For this reason your least permissioned roles come first in the parents array.
Adding the `admin` role is as follows:

```php
$acl->addRole(new Role('admin'), ['guest', 'user']);
```

## Creating the Access Control List

An Access Control List (ACL) can represent any set of physical or virtual objects that you wish.
Expand Down

0 comments on commit 3a81215

Please sign in to comment.