Guardian.Plug.EnsurePermissions

Use this plug to ensure that there are the correct permissions set in the claims found on the connection.

Example

plug Guardian.Plug.EnsurePermissions, admin: [:read, :write], on_failure: { SomeMod, :some_func } # read and write permissions for the admin set
plug Guardian.Plug.EnsurePermissions, admin: [:read, :write], default: [:profile], on_failure: { SomeMod, :some_func } # read AND write permissions for the admin set AND :profile for the default set

plug Guardian.Plug.EnsurePermissions, key: :secret, admin: [:read, :write], on_failure: { SomeMod, :some_func } # admin :read AND :write for the claims located in the :secret location

On failure will be handed the connection with the conn, and params where reason: :forbidden

Summary

init(opts)

Functions

init(opts)