firebase-admin.security-rules package

Cloud Firestore 및 Cloud Storage의 보안 규칙

Functions

함수 설명
getSecurityRules(앱) 기본 앱 또는 특정 앱의 SecurityRules 서비스를 가져옵니다.admin.securityRules()는 기본 앱의 SecurityRules 서비스에 액세스하기 위한 인수 없이 호출하거나 admin.securityRules(app)로 호출하여 특정 앱과 연결된 SecurityRules 서비스에 액세스할 수 있습니다.

클래스

클래스 설명
규칙 세트 Firebase 보안 규칙 모음입니다.
RulesetMetadataList 규칙 세트 메타데이터 페이지입니다.
SecurityRules Firebase SecurityRules 서비스 인터페이스

인터페이스

인터페이스 설명
RulesetMetadata를 제공합니다. 규칙 세트와 연결된 필수 메타데이터입니다.
규칙 파일 Firebase 보안 규칙이 포함된 소스 파일입니다. 콘텐츠에는 텍스트 서식, 들여쓰기 및 주석 등의 원시 소스 코드가 포함됩니다. 이 유형의 새 인스턴스를 만들려면 SecurityRules.createRulesFileFromSource() 메서드를 사용하세요.

getSecurityRules(앱)

기본 앱 또는 특정 앱에 대한 SecurityRules 서비스를 가져옵니다.

admin.securityRules()를 기본 앱의 SecurityRules 서비스에 액세스하기 위한 인수 없이 호출하거나 admin.securityRules(app)로 호출하여 특정 앱과 연결된 SecurityRules 서비스에 액세스할 수 있습니다.

서명:

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

매개변수

매개변수 유형 설명
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);