firebase-admin.security-rules package

Cloud Firestore と Cloud Storage のセキュリティ ルール。

関数

関数 説明
getSecurityRules(app) デフォルト アプリまたは特定のアプリの SecurityRules サービスを取得します。引数なしで admin.securityRules() を呼び出してデフォルト アプリの SecurityRules サービスにアクセスするか、admin.securityRules(app) として呼び出して、特定のアプリに関連付けられている SecurityRules サービスにアクセスできます。

クラス

クラス 説明
ルールセット Firebase セキュリティ ルールのセット。
RulesetMetadataList ルールセット メタデータのページ。
SecurityRules Firebase SecurityRules サービス インターフェース。

インターフェース

インターフェース 説明
RulesetMetadata ルールセットに関連付けられた必須メタデータ。
RulesFile いくつかの Firebase セキュリティ ルールを含むソースファイル。コンテンツには、テキストの書式設定、インデント、コメントなどの未加工のソースコードが含まれています。このタイプの新しいインスタンスを作成するには、SecurityRules.createRulesFileFromSource() メソッドを使用します。

getSecurityRules(アプリ)

デフォルト アプリまたは指定されたアプリの SecurityRules サービスを取得します。

admin.securityRules() を引数なしで呼び出してデフォルト アプリの SecurityRules サービスにアクセスするか、admin.securityRules(app) として呼び出して特定のアプリに関連付けられている SecurityRules サービスにアクセスします。

署名:

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

パラメータ

パラメータ 説明
app アプリ SecurityRules サービスを返すオプションのアプリ。指定されていない場合は、デフォルトの SecurityRules サービスが返されます。

戻り値:

SecurityRules

アプリが指定されていない場合は、デフォルトの SecurityRules サービス、または指定されたアプリに関連付けられている SecurityRules サービス。

例 1

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

例 2

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