5v5cv6b7n87h89j0- old -rule - on firebase - backup = true= can use✅️✅️✅️✅️

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    
    // --- 1. 原有的 prices (完全不动) ---
    match /prices/{docId} {
      allow read: if true;
      allow write: if request.auth != null && request.auth.token.email == "mrjacky.bc@gmail.com";
    }

    // --- 2. goldegg 配置/价格 (之前的代码用这个) ---
    match /goldegg/{docId} {
      allow read: if true;
      allow write: if request.auth != null && request.auth.token.email == "mrjacky.bc@gmail.com";
    }

    // --- 3. [新增] 白名单配置 (Admin Dashboard 用这个) ---
    // 必须添加这段,否则 "goldegg_whitelist" 集合会被拒绝写入
    match /goldegg_whitelist/{docId} {
      allow read: if true;  // 前端用户需要读取自己的VIP等级
      allow write: if request.auth != null && request.auth.token.email == "mrjacky.bc@gmail.com";
    }

  }
}