Restrict access to page is applied through the pages manager.
Rules are applied through a function, which means there is a variable scoping problem when trying to use a recordset in a rule. You can save the value from the recordset into a session variable and then compare two session variables in the rule.