Skip to content

Commit 2f5dd9d

Browse files
committed
Cleanup and Readme corrections.
1 parent c3cf5d3 commit 2f5dd9d

File tree

3 files changed

+12
-248
lines changed

3 files changed

+12
-248
lines changed

.gitattributes

Lines changed: 0 additions & 22 deletions
This file was deleted.

.gitignore

Lines changed: 0 additions & 215 deletions
This file was deleted.

README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Version 0.0.1 Created by Frank Hein and the maxence team
55
Introduction
66
------------
77

8-
MxcRouteGuard restricts access to routes by unauthenticated users.
8+
MxcRouteGuard restricts access to routes for unauthenticated users.
99
Out of the box MxcRouteGuard works with ZfcUser, however, alternative authentication
1010
may be used as long as they provide a public function hasIdentity() returning bool.
1111
MxcRouteGuard is designed to be very simple.
@@ -74,33 +74,34 @@ The following options are available:
7474

7575
- **auth_service** - Name of Authentication Service class to use. Useful for using your own
7676
authentication service instead of the default ZfcUser. Default is `zfcuser_auth_service`.
77-
- **guard_mode** - Two modes ('white', 'black') are provided to handle the observed routes list
77+
- **guard_mode** - Two modes (`white`, `black`) are provided to handle the observed routes list
7878
(see below). In whitelist mode all routes but the routes provided in the observed routes list
7979
are protected from anonymous access. In blacklist mode only the routes provided in the observed
80-
route list are protected from anonymous acceess. Default is 'white'.
81-
- **observed_routes** - List of routes to protect from anonymous success (black mode) or allow to
82-
anonymous access (white mode)
80+
route list are protected from anonymous acceess. Default is `white`.
81+
- **observed_routes** - List of routes to protect from anonymous success (`black` mode) or allow to
82+
anonymous access (`white` mode). Default: `array()`
8383
- **anonymous_redirect** - If access gets blocked the anonymous user gets redirected to the route
8484
specified here. Note: The anonymous_redirect route automatically gets whitelisted regardless of
85-
the guard mode. Default: 'zfcuser/login'
85+
the guard mode. Default: `zfcuser/login`
8686
- **strategy** - By default MxcRouteGuard redirects attempts to access protected routes by an
8787
anonymous user. If you want something else but a redirect to happen you may supply an alternative
8888
strategy here to handle anonymous access.
89+
Default: `MxcRouteGuard\Service\Strategy\RedirectStrategy`
8990

9091
ZfcUser support
9192
---------------
9293

9394
If ZfcUser is used and the ZfcUser enable_registration flag is set true then MxcRouteGuard
94-
automatically whitelists 'zfcuser/register' regardless of the guard mode.
95+
automatically whitelists `zfcuser/register` regardless of the guard mode.
9596

96-
In case a route gets blocked MxcRouteGuard applies a redirectto parameter to the anonymous_redirect
97-
route which can be used by ZfcUser, if the use_redirect_parameter_if_present setting is set true.
97+
In case a route gets blocked MxcRouteGuard applies a `redirectto` parameter to the anonymous_redirect
98+
route which can be used by ZfcUser, if the `use_redirect_parameter_if_present` setting is set `true`.
9899

99100
Note
100101
----
101102

102-
For authenticated users MxcRouteGuard provides full access to all routes. If you need a more
103-
detailled control of who can access what route, use ZfcRbac or BjyAuthorize or similar modules
103+
For authenticated users MxcRouteGuard provides full access to all routes. If you need more
104+
detailled control of who can access what route, use [ZfcRbac](https://github.com/ZF-Commons/ZfcRbac) or [BjyAuthorize](https://github.com/bjyoungblood/BjyAuthorize) or similar modules
104105
instead of MxcRouteGuard.
105106

106107
Common use cases for MxcRouteGuard are demo apps which only require a user to be known.

0 commit comments

Comments
 (0)