Classes

Class Description
Ruleset A set of Firebase security rules.
RulesetMetadataList A page of ruleset metadata.
SecurityRules The Firebase SecurityRules service interface.

Functions

Function Description
getSecurityRules(app) Gets the service for the default app or a given app.admin.securityRules() can be called with no arguments to access the default app's service, or as admin.securityRules(app) to access the service associated with a specific app.

Interfaces

Interface Description
RulesetMetadata Required metadata associated with a ruleset.
RulesFile A source file containing some Firebase security rules. The content includes raw source code including text formatting, indentation and comments. Use the [securityRules.createRulesFileFromSource()](securityRules.SecurityRules#createRulesFileFromSource) method to create new instances of this type.

getSecurityRules()

Gets the service for the default app or a given app.

admin.securityRules() can be called with no arguments to access the default app's service, or as admin.securityRules(app) to access the service associated with a specific app.

Signature:

export declare function getSecurityRules(app?: App): SecurityRules;

Parameters

Parameter Type Description
app App Optional app to return the SecurityRules service for. If not provided, the default SecurityRules service is returned. The default SecurityRules service if no app is provided, or the SecurityRules service associated with the provided app.

Returns:

SecurityRules

Example 1

// Get the SecurityRules service for the default app
const defaultSecurityRules = getSecurityRules();

Example 2

```javascript // Get the SecurityRules service for a given app const otherSecurityRules = getSecurityRules(otherApp); ```