lib/acl9/controller_extensions/dsl_base.rb in acl9-1.3.0 vs lib/acl9/controller_extensions/dsl_base.rb in acl9-2.0.0
- old
+ new
@@ -90,11 +90,16 @@
alias everyone all
alias everybody all
alias anyone all
+ def _permitted_allow_deny_option!(key)
+ raise ArgumentError, "#{key} is not a valid option" unless [:to, :except, :if, :unless, *VALID_PREPOSITIONS].include?(key.to_sym)
+ end
+
def _parse_and_add_rule(*args)
options = args.extract_options!
+ options.keys.each { |key| _permitted_allow_deny_option!(key) }
_set_action_clause(options.delete(:to), options.delete(:except))
object = _role_object(options)