Module: Padrino::Admin::Helpers::AuthenticationHelpers
Overview
Common helpers used for authorization within an application.
Instance Method Summary
-
#allowed? ⇒ BooleanReturns true if thecurrent_accountis allowed to see the requested path. -
#current_account ⇒ ObjectReturns the current_account, it's an instance of Account model. -
#logged_in? ⇒ BooleanReturns true ifcurrent_accountis logged and active. -
#login_required ⇒ ObjectReturns a helper useful in abefore_filterfor check if an account are:logged_in?andallowed?. -
#project_modules ⇒ ObjectReturns project modules for the current account. -
#redirect_back_or_default(default) ⇒ ObjectRedirect 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) ⇒ ObjectOverride the current_account, you must provide an instance of Account model. -
#store_location! ⇒ ObjectStore in session the env.
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
#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.
#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.
© 2010–2020 Padrino
Licensed under the MIT License.
https://www.rubydoc.info/github/padrino/padrino-framework/Padrino/Admin/Helpers/AuthenticationHelpers