firebase-admin.security-rules package Stay organized with collections Save and categorize content based on your preferences.
Security Rules for Cloud Firestore and Cloud Storage.
Functions
| Function | Description |
|---|---|
| getSecurityRules(app) | Gets theSecurityRules service for the default app or a given app.admin.securityRules() can be called with no arguments to access the default app'sSecurityRules service, or asadmin.securityRules(app) to access theSecurityRules service associated with a specific app. |
Classes
| Class | Description |
|---|---|
| Ruleset | A set of Firebase security rules. |
| RulesetMetadataList | A page of ruleset metadata. |
| SecurityRules | The FirebaseSecurityRules service interface. |
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 theSecurityRules.createRulesFileFromSource() method to create new instances of this type. |
getSecurityRules(app)
Gets theSecurityRules service for the default app or a given app.
admin.securityRules() can be called with no arguments to access the default app'sSecurityRules service, or asadmin.securityRules(app) to access theSecurityRules service associated with a specific app.
Signature:
exportdeclarefunctiongetSecurityRules(app?:App):SecurityRules;Parameters
| Parameter | Type | Description |
|---|---|---|
| app | App | Optional app to return theSecurityRules service for. If not provided, the defaultSecurityRules service is returned. |
Returns:
The defaultSecurityRules service if no app is provided, or theSecurityRules service associated with the provided app.
Example 1
// Get the SecurityRules service for the default appconstdefaultSecurityRules=getSecurityRules();Example 2
// Get the SecurityRules service for a given appconstotherSecurityRules=getSecurityRules(otherApp);Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-04-16 UTC.