Module: Beef::AdminArea::Roles::InstanceMethods
- Defined in:
- lib/admin_area.rb
Instance Method Summary collapse
Instance Method Details
#authorised?(*auth_roles) ⇒ Boolean
70 71 72 73 74 75 76 77 78 |
# File 'lib/admin_area.rb', line 70 def (*auth_roles) return false if role.blank? # Check the roles are real non_roles = auth_roles - User::ROLES unless non_roles.empty? raise ArgumentError, "No such role #{non_roles.join(', ')}" end auth_roles.include?(role.to_sym) end |