Gardien v0.0.2 Gardien
Gardien authorization.
Summary
Functions
Verify whether user is allowed to perform some action on a given resource
Verify whether action is allowed in a given context
Verify whether user is allowed to perform some action on a given resource
Verify whether action is allowed in a given context
Verify whether user is allowed to perform some action on a given resource
Functions
Verify whether user is allowed to perform some action on a given resource.
user
and action
(controller action) are extracted from Plug.Conn
struct.
Returns {:ok, resource}
when user is authorized and
{:error, context}
otherwise.
Verify whether action is allowed in a given context.
As a context
you can pass the actual user or conn
(Plug.Conn).
Gardien will extract user from conn
based on it’s gardien_user
configuration.
Returns {:ok, resource}
when user is authorized and
{:error, err_context}
otherwise.
Verify whether user is allowed to perform some action on a given resource.
user
and action
(controller action) are extracted from Plug.Conn
struct.
Returns :ok
when user is authorized and raises Gardien.AuthorizationError
otherwise.
Verify whether action is allowed in a given context.
As a context
you can pass the actual user or conn
(Plug.Conn).
Gardien will extract user from conn
based on it’s gardien_user
configuration.
Returns :ok
when user is authorized and raises Gardien.AuthorizationError
otherwise.