Module: Rolypoly::ControllerRoleDSL::InstanceMethods
- Defined in:
- lib/rolypoly/controller_role_dsl.rb
Instance Method Summary collapse
- #allow?(options = {}) ⇒ Boolean
- #current_gatekeepers ⇒ Object
- #current_roles ⇒ Object
- #failed_role_check! ⇒ Object
- #public? ⇒ Boolean
- #rolypoly_check_role_access! ⇒ Object
Instance Method Details
#allow?(options = {}) ⇒ Boolean
47 48 49 |
# File 'lib/rolypoly/controller_role_dsl.rb', line 47 def allow?( = {}) rolypoly_gatekeepers.allow?(current_roles, action_name, rolypoly_resource_map.merge()) end |
#current_gatekeepers ⇒ Object
41 42 43 44 45 |
# File 'lib/rolypoly/controller_role_dsl.rb', line 41 def current_gatekeepers rolypoly_gatekeepers.select { |gatekeeper| gatekeeper.action? action_name } end |
#current_roles ⇒ Object
33 34 35 |
# File 'lib/rolypoly/controller_role_dsl.rb', line 33 def current_roles allowed_roles(action_name) end |
#failed_role_check! ⇒ Object
29 30 31 |
# File 'lib/rolypoly/controller_role_dsl.rb', line 29 def failed_role_check! raise Rolypoly::FailedRoleCheckError end |
#public? ⇒ Boolean
37 38 39 |
# File 'lib/rolypoly/controller_role_dsl.rb', line 37 def public? super(action_name) end |
#rolypoly_check_role_access! ⇒ Object
25 26 27 |
# File 'lib/rolypoly/controller_role_dsl.rb', line 25 def rolypoly_check_role_access! failed_role_check! unless rolypoly_role_access? end |