From 7de5c3af731c8adabc8709aba38401f8c6fba458 Mon Sep 17 00:00:00 2001 From: Stefan Butz Date: Sat, 30 Dec 2023 15:51:11 +0700 Subject: [PATCH] Deploy security rules --- .github/workflows/deploy-on-merge.yml | 6 ++++++ firebase/package.json | 2 +- firebase/storage.rules | 4 ---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy-on-merge.yml b/.github/workflows/deploy-on-merge.yml index 47637da..d8fce1a 100644 --- a/.github/workflows/deploy-on-merge.yml +++ b/.github/workflows/deploy-on-merge.yml @@ -6,6 +6,12 @@ on: push: branches: - master + #TODO: remove + pull_request: + types: + - opened + - synchronize + - reopend jobs: rules_deploy: runs-on: ubuntu-latest diff --git a/firebase/package.json b/firebase/package.json index e9a16e2..191715f 100644 --- a/firebase/package.json +++ b/firebase/package.json @@ -6,7 +6,7 @@ "author": "", "license": "ISC", "scripts": { - "deploy": "npx firebase-tools deploy --only 'firestore:rules,storage:rules'", + "deploy": "npx firebase-tools deploy --only 'firestore,storage'", "test": "npx firebase-tools emulators:exec --only 'firestore,storage' 'jest -i'", "export": "npx firebase-tools emulators:export ./emulator_data", "lint": "eslint src" diff --git a/firebase/storage.rules b/firebase/storage.rules index e4f1e28..d061515 100644 --- a/firebase/storage.rules +++ b/firebase/storage.rules @@ -14,10 +14,6 @@ service firebase.storage { return isClubMember(clubId) && request.auth.token.admin == true; } - function isTableAdmin(clubId, tableId) { - return isClubMember(clubId) && request.auth.token.tableId == tableId; - } - match /clubs/{clubId}/{image} { function canUpdate() { return image in ['logo.jpeg'].toSet()