def matches?(person, context_binding)
      matched = if BUILTIN_ROLES.include? @roles[0]
        has_builtin_authorization? person, context_binding
      else
        has_named_authorizations? person, context_binding
      end

      passed_conditionals = matched ? passes_conditionals?(person, context_binding) : false
      passed = matched && passed_conditionals
      return passed
    end
def matches?(person, context_binding)
      matched = if BUILTIN_ROLES.include? @roles[0]
        has_builtin_authorization? person, context_binding
      else
        has_named_authorizations? person, context_binding
      end

      passed_conditionals = matched ? passes_conditionals?(person, context_binding) : false
      passed = matched && passed_conditionals
      return passed
    end
Creates a new PermitRule.

 +:if+ and +:unless+ conditions may be evaluated for static, dynamic, and
 named authorizations. They are evaluated after the other rule checks are
 applied, and only if the rule still matches. The conditionals may make a
 matching rule not match, but will not make an unmatched rule match. If
 both +:if+ and +:unless+ are given the +:if+ condition is run first, and
 if the rule still matches the +:unless+ will be run.

 @param [:person, :guest, :everyone, Symbol, <Symbol>] roles the role(s) to
   test against.
   - :person - +current_person.guest? == false+ This person should be
     authenticated. This indicates a dynamic authorization.
   - :guest - +current_person.guest? == true+ This is a person that is not
     authenticated. This is a static authorization.
   - :everyone - Any user of the system. This is a static authorization.
   - Symbol/<Symbol> - This is the key or keys of any of the role(s) to
     match against in the database. This indicates a named authorization.
 @param [Hash] options the options to use to configure the authorization.
 @option options [Symbol] :who Indicates that a method should be checked on
   the target object to authorize. Checks a variety of possibilities,
   taking the first variation that the target responds to.

   When the symbol is prefixed with 'is_' then multiple methods will be
   tried passing the person in. The methods tried for +:is_owner+ would be
   +is_owner()+, +is_owner?()+, +owner()+, +owner+, +owners.exist?()+. If
   this option is given +:of+/+:on+ must also be given.
 @option options [Symbol] :that alias for +:who+
 @option options [Symbol, nil, :any, <Symbol, nil>] :of The name of the
   instance variable(s) to use as the target resource(s).

   In a dynamic authorization this is the object that will be tested using
   the value of +:who+/+:that+.

   In a named authorization this is the resource the person must be
   authorized on for one or more of the roles. +:any+ may be given to
   indicate a match if the person has one of the roles for any resource. If
   not given, or set to +nil+, then the match will apply to a person that
   has a matching role authorization for a nil resource.
 @option options [Symbol, nil, :any, <Symbol, nil>] :on alias for +:of+
 @option options [Symbol, String, Proc] :if code to evaluate at the end of the
   match if it is still valid. If it returns false, the rule will not
   match. If a proc if given, it will be passed the current subject and
   binding. A method will be called without any arguments.
 @option options [Symbol, String, Proc] :unless code to evaluate at the end of
   the match if it is still valid. If it returns true, the rule will not
   match. If a proc if given, it will be passed the current subject and
   binding. A method will be called without any arguments.

 @raise [PermitConfigurationError] if the rule options are invalid.
 Determine if the passed in person matches this rule.

 @param [permit_person] person the person to evaluate for authorization
 @param [Binding] context_binding the binding to use to locate the resource
   and/or evaluate the if/unless conditions.
 @return [Boolean] true if the person matches the rule, otherwise
   false.
 @raise [PermitEvaluationError] if there is a problem evaluating the rule.