Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
geggleto committed Jan 8, 2016
1 parent 05fddad commit 18aa234
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,25 @@ $app->add(\Geggleto\Acl\AclRepository(["guest"],
]));
```

# See Unit test class for more detailed usage
# Dynamic Routes
In the case where your resource changes, it is possible to still correctly match by setting a resources with a Route Pattern.
By default the system will inspect the $request's 'route' attribute and this Object should return the route pattern with ->getPatter();
Out of the box this will work with Slim 3 routes if you have turned on the 'determineRouteBeforeAppMiddleware' => true option.

Example Config:
```php
return [
"resources" => ["/", "/login", "/grid", "/404", "/logout", "/roles", "/roles/{pein}"],
"roles" => ["guest", "grid", "roles"],
"assignments" => [
"allow" => [
"guest" => ["/", "/404", "/login"],
"grid" => [ '/grid', '/logout' ],
"roles" => ['/roles', '/roles/{pein}']
],
"deny" => []
]
];
```

If this does not fit your usage, feel free to override the default handler by setting your own via `setHandler(callable)`

0 comments on commit 18aa234

Please sign in to comment.