Module: Padrino::Admin::Helpers::AuthenticationHelpers


Common helpers used for authorization within an application.

Instance Method Summary

Instance Method Details

#allowed? ⇒ Boolean

Returns true if the current_account is allowed to see the requested path.

For configure this role please refer to: Padrino::Admin::AccessControl::Base


  • (Boolean)

#current_account ⇒ Object

Returns the current_account, it's an instance of Account model.

#logged_in? ⇒ Boolean

Returns true if current_account is logged and active.


  • (Boolean)

#login_required ⇒ Object

Returns a helper useful in a before_filter for check if an account are: logged_in? and allowed?

By default this method is used in Admin Apps.

#project_modules ⇒ Object

Returns project modules for the current account.

#redirect_back_or_default(default) ⇒ Object

Redirect the account to the page that requested an authentication or if the account is not allowed/logged return it to a default page.

#set_current_account(account = nil) ⇒ Object

Override the current_account, you must provide an instance of Account model.


set_current_account(Account.authenticate(params[:email], params[:password])

#store_location! ⇒ Object

Store in session the env.