Gets the SecurityRules service for the default app or a given app.admin.securityRules() can be called with no arguments to access the default app's SecurityRules service, or as admin.securityRules(app) to access the SecurityRules service associated with a specific app.
A source file containing some Firebase security rules. The content includes raw source code including text formatting, indentation and comments. Use the SecurityRules.createRulesFileFromSource() method to create new instances of this type.
getSecurityRules(app)
Gets the SecurityRules service for the default app or a given app.
admin.securityRules() can be called with no arguments to access the default app's SecurityRules service, or as admin.securityRules(app) to access the SecurityRules service associated with a specific app.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-16 UTC."],[],[],null,["# firebase-admin.security-rules package\n\nSecurity Rules for Cloud Firestore and Cloud Storage.\n\nFunctions\n---------\n\n| Function | Description |\n|--------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [getSecurityRules(app)](./firebase-admin.security-rules.md#getsecurityrules_8a40afc) | Gets the [SecurityRules](./firebase-admin.security-rules.securityrules.md#securityrules_class) service for the default app or a given app.`admin.securityRules()` can be called with no arguments to access the default app's `SecurityRules` service, or as `admin.securityRules(app)` to access the `SecurityRules` service associated with a specific app. |\n\nClasses\n-------\n\n| Class | Description |\n|---------------------------------------------------------------------------------------------------------|-------------------------------------------------|\n| [Ruleset](./firebase-admin.security-rules.ruleset.md#ruleset_class) | A set of Firebase security rules. |\n| [RulesetMetadataList](./firebase-admin.security-rules.rulesetmetadatalist.md#rulesetmetadatalist_class) | A page of ruleset metadata. |\n| [SecurityRules](./firebase-admin.security-rules.securityrules.md#securityrules_class) | The Firebase `SecurityRules` service interface. |\n\nInterfaces\n----------\n\n| Interface | Description |\n|-------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [RulesetMetadata](./firebase-admin.security-rules.rulesetmetadata.md#rulesetmetadata_interface) | Required metadata associated with a ruleset. |\n| [RulesFile](./firebase-admin.security-rules.rulesfile.md#rulesfile_interface) | A source file containing some Firebase security rules. The content includes raw source code including text formatting, indentation and comments. Use the [SecurityRules.createRulesFileFromSource()](./firebase-admin.security-rules.securityrules.md#securityrulescreaterulesfilefromsource) method to create new instances of this type. |\n\ngetSecurityRules(app)\n---------------------\n\nGets the [SecurityRules](./firebase-admin.security-rules.securityrules.md#securityrules_class) service for the default app or a given app.\n\n`admin.securityRules()` can be called with no arguments to access the default app's `SecurityRules` service, or as `admin.securityRules(app)` to access the `SecurityRules` service associated with a specific app.\n\n**Signature:** \n\n export declare function getSecurityRules(app?: App): SecurityRules;\n\n### Parameters\n\n| Parameter | Type | Description |\n|-----------|------|---------------------------------------------------------------------------------------------------------------------------|\n| app | App | Optional app to return the `SecurityRules` service for. If not provided, the default `SecurityRules` service is returned. |\n\n**Returns:**\n\n[SecurityRules](./firebase-admin.security-rules.securityrules.md#securityrules_class)\n\nThe default `SecurityRules` service if no app is provided, or the `SecurityRules` service associated with the provided app.\n\n### Example 1\n\n // Get the SecurityRules service for the default app\n const defaultSecurityRules = getSecurityRules();\n\n### Example 2\n\n // Get the SecurityRules service for a given app\n const otherSecurityRules = getSecurityRules(otherApp);"]]