@@ -75,6 +75,12 @@ AUTHENTICATION PROVIDERS
7575 Dancer2::Plugin::Auth::Extensible::Provider::Database
7676 Authenticates users stored in a database table
7777
78+ Dancer2::Plugin::Auth::Extensible::Provider::IMAP
79+ Authenticates users via in an IMAP server.
80+
81+ Dancer2::Plugin::Auth::Extensible::Provider::LDAP
82+ Authenticates users stored in an LDAP directory.
83+
7884 Need to write your own? Just create a new provider class which consumes
7985 Dancer2::Plugin::Auth::Extensible::Role::Provider and implements the
8086 required methods, and you're good to go!
@@ -98,6 +104,9 @@ CONTROLLING ACCESS TO ROUTES
98104 login page URL. If they are logged in, but do not have the required
99105 role, they will be redirected to the access denied URL.
100106
107+ If "disable_roles" configuration option is set to a true value then
108+ using "require_role" will cause the application to croak on load.
109+
101110 require_any_roles - require the user to have one of a list of roles
102111 get '/drink' => require_any_role [qw(BeerDrinker VodaDrinker)] => sub {
103112 ...
@@ -109,6 +118,10 @@ CONTROLLING ACCESS TO ROUTES
109118 not have any of the specified roles, they will be redirected to the
110119 access denied URL.
111120
121+ If "disable_roles" configuration option is set to a true value then
122+ using "require_any_roles" will cause the application to croak on
123+ load.
124+
112125 require_all_roles - require the user to have all roles listed
113126 get '/foo' => require_all_roles [qw(Foo Bar)] => sub { ... };
114127
@@ -118,6 +131,10 @@ CONTROLLING ACCESS TO ROUTES
118131 the specified roles, they will be redirected to the access denied
119132 URL.
120133
134+ If "disable_roles" configuration option is set to a true value then
135+ using "require_all_roles" will cause the application to croak on
136+ load.
137+
121138 Replacing the Default " /login " and " /login/denied " Routes
122139 By default, the plugin adds a route to present a simple login form at
123140 that URL. If you would rather add your own, set the "no_default_pages"
@@ -239,6 +256,10 @@ CONTROLLING ACCESS TO ROUTES
239256
240257 if (user_has_role($user, $role)) { .... }
241258
259+ If "disable_roles" configuration option is set to a true value then
260+ using "user_has_role" will cause the application to croak at
261+ runtime.
262+
242263 user_roles
243264 Returns a list of the roles of a user.
244265
@@ -247,6 +268,9 @@ CONTROLLING ACCESS TO ROUTES
247268
248269 Returns a list or arrayref depending on context.
249270
271+ If "disable_roles" configuration option is set to a true value then
272+ using "user_roles" will cause the application to croak at runtime.
273+
250274 authenticate_user
251275 Usually you'll want to let the built-in login handling code deal
252276 with authenticating users, but in case you need to do it yourself,
@@ -574,6 +598,9 @@ CONTROLLING ACCESS TO ROUTES
574598 plugins:
575599 Auth::Extensible:
576600 # Set to 1 if you want to disable the use of roles (0 is default)
601+ # If roles are disabled then any use of role-based route decorators
602+ # will cause app to croak on load. Use of 'user_roles' and
603+ # 'user_has_role' will croak at runtime.
577604 disable_roles: 0
578605 # After /login: If no return_url is given: land here ('/' is default)
579606 user_home_page: '/user'
@@ -607,8 +634,12 @@ CONTROLLING ACCESS TO ROUTES
607634 # you wish to use)
608635 realms:
609636 realm_one:
637+ priority: 3 # Defaults to 0. Realms are checked in descending order
610638 provider: Database
611639 db_connection_name: 'foo'
640+ realm_two:
641+ priority: 0 # Will be checked after realm_one
642+ provider: Config
612643
613644 Please note that you must have a session provider configured. The
614645 authentication framework requires sessions in order to track information
@@ -641,7 +672,7 @@ AUTHOR
641672
642673 Stefan Hornburg (Racke), "<racke at linuxia.de>"
643674
644- Conversion to Dancer2's new plugin system in 2016 by :
675+ Conversion to Dancer2's new plugin system plus much cleanup & reorg :
645676
646677 Peter Mottram (SysPete), "<peter at sysnix.com>"
647678
0 commit comments