Openmaize.Authorize
Plug that performs a basic check that users are authorized to access the requested pages / resources.
Authorization is based on user roles, and so you will need a role
entry
in your user model.
There is one option:
redirects
- if true, which is the default, redirect if authorized or if there is an error
Examples
Call Authorize without any options:
plug Openmaize.Authorize
Call Authorize without redirects:
plug Openmaize.Authorize, redirects: false
Summary↑
call(conn, opts) | Verify that the user is authorized to access the requested page / resource |
init(opts) | Callback implementation for |
Functions
Verify that the user is authorized to access the requested page / resource.
Callback implementation for c:Plug.init/1
.