You're viewing the legacy docs. They are deprecated as of May 18, 2016.
Go to current docs

“data” Rule Variable

The data variable gives you a RuleDataSnapshot corresponding to the current data in the database location of the currently executing rule (as opposed to root, which gives you the data for the root of your database).

So for example, if you wanted to let any client access /users/<user> if /users/<user>/public was set to true, you could use:

  "rules": {
    "users": {
      "$user": {
        ".read": "data.child('public').val() == true"

The data variable is available in .read, .write, and .validate rules.