# Namespace: rules

# rules

namespace

Firebase Security Rules provide access control and data validation
in a simple yet expressive language. They are used to secure products
such as Cloud Storage and Cloud Firestore.

This documentation is divided into two sections:

- [**Interfaces**](https://firebase.google.com/docs/reference/rules/rules#interfaces) - data types common to all products that use Security Rules.
- [**Namespaces**](https://firebase.google.com/docs/reference/rules/rules#namespaces) - data types and functions that are product or context specific.

## Interfaces

### [Boolean](https://firebase.google.com/docs/reference/rules/rules.Boolean)

Primitive type representing a boolean value, `true` or
`false`.

### [Bytes](https://firebase.google.com/docs/reference/rules/rules.Bytes)

Type representing a sequence of bytes.

### [Duration](https://firebase.google.com/docs/reference/rules/rules.Duration)

Time duration with nanosecond accuracy.

### [Float](https://firebase.google.com/docs/reference/rules/rules.Float)

Primitive type representing a 64-bit IEEE floating point number.

### [Integer](https://firebase.google.com/docs/reference/rules/rules.Integer)

Primitive data type representing a signed 64-bit integer value.

### [LatLng](https://firebase.google.com/docs/reference/rules/rules.LatLng)

Latitude and longitude geopoint.

### [List](https://firebase.google.com/docs/reference/rules/rules.List)

Heterogeneous list of items.

### [Map](https://firebase.google.com/docs/reference/rules/rules.Map)

Key-value mapping.

### [MapDiff](https://firebase.google.com/docs/reference/rules/rules.MapDiff)

Object representing the difference between [rules.Map](https://firebase.google.com/docs/reference/rules/rules.Map)
objects.

### [Number](https://firebase.google.com/docs/reference/rules/rules.Number)

A value of type `Integer` or type `Float`.

### [Path](https://firebase.google.com/docs/reference/rules/rules.Path)

Directory-like pattern for the location of a resource.

### [Set](https://firebase.google.com/docs/reference/rules/rules.Set)

Unordered, heterogeneous list of unique items.

### [String](https://firebase.google.com/docs/reference/rules/rules.String)

Primitive type representing a string value.

### [Timestamp](https://firebase.google.com/docs/reference/rules/rules.Timestamp)

Timestamp in UTC with nanosecond accuracy.

## Namespaces

### [debug](https://firebase.google.com/docs/reference/rules/rules.debug)

Security Rules language debug statement

### [duration](https://firebase.google.com/docs/reference/rules/rules.duration_)

Globally available duration functions.

### [firestore](https://firebase.google.com/docs/reference/rules/rules.firestore)

Variables and functions available in Cloud Firestore rules.

### [hashing](https://firebase.google.com/docs/reference/rules/rules.hashing)

Globally available hashing functions.

### [latlng](https://firebase.google.com/docs/reference/rules/rules.latlng_)

Globally available latitude-longitude functions.

### [math](https://firebase.google.com/docs/reference/rules/rules.math)

Globally available mathematical functions.

### [timestamp](https://firebase.google.com/docs/reference/rules/rules.timestamp_)

Globally available timestamp functions.