Module: FlexibleAccessibility::ControllerMethods
- Defined in:
- lib/flexible_accessibility/controller_methods.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
-
.included(base) ⇒ Object
Callback is needed for include methods and define helper method.
Instance Method Summary collapse
-
#has_access?(permission, user) ⇒ Boolean
Check the url for each link in view to show it.
Class Method Details
.included(base) ⇒ Object
Callback is needed for include methods and define helper method
58 59 60 61 |
# File 'lib/flexible_accessibility/controller_methods.rb', line 58 def self.included(base) base.extend(ClassMethods) base.helper_method(:has_access?) end |
Instance Method Details
#has_access?(permission, user) ⇒ Boolean
Check the url for each link in view to show it
64 65 66 67 |
# File 'lib/flexible_accessibility/controller_methods.rb', line 64 def has_access?(, user) raise UnknownUserException if user.nil? AccessProvider.is_action_permitted_for_user?(, user) end |