Module: Beef::AdminArea::Authorisation::InstanceMethods
- Defined in:
- lib/admin_area.rb
Instance Method Summary collapse
- #authorise(*roles) ⇒ Object
- #authorised?(*roles, &block) ⇒ Boolean
- #not_authorised?(*roles, &block) ⇒ Boolean
Instance Method Details
#authorise(*roles) ⇒ Object
27 28 29 |
# File 'lib/admin_area.rb', line 27 def (*roles) deny_access("You do not have the required access privileges to access page") unless current_user.(*roles) end |
#authorised?(*roles, &block) ⇒ Boolean
31 32 33 34 35 36 37 38 |
# File 'lib/admin_area.rb', line 31 def (*roles, &block) return unless current_user.(*roles) if block_given? yield else return true end end |
#not_authorised?(*roles, &block) ⇒ Boolean
40 41 42 43 44 45 46 47 |
# File 'lib/admin_area.rb', line 40 def (*roles, &block) return if current_user.(*roles) if block_given? yield else return true end end |