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

“root” Rule Variable

The root variable gives you a RuleDataSnapshot corresponding to the current data at the root of your Firebase database. You can use this to read any data in your database in your rule expressions. For instance, if we wanted to allow users to read /comments only if their /users/<id>/active was set to true, we could use:

  "rules": {
    "comments": {
      ".read": "root.child('users').child(auth.uid).child('active').val() == true"

Then, if /users/barney/active contained the value true, a user authenticated with a uid of "barney" could write to the /comments node.