Realtime Database

Storage

Edit and update your rules

Edit your rules directly in the .rules configuration file. Make sure that any
edits you make in the Firebase CLI are reflected in the Firebase console, or
that you consistently make updates using either the Firebase console or the
Firebase CLI. Otherwise, you might overwrite any updates made in the Firebase
console.

Note:When you
deploy security rules using the Firebase CLI,
the rules defined in your project directory overwrite any existing rules in the
Firebase console. So, if you choose to define or edit your security rules
using the Firebase console, make sure that you also update the rules defined
in your project directory.

Test your updates

Use the Firebase emulator to test your updates locally and
confirm that your app's Rules exhibit the behavior you want.

Deploy your updates

Once you've updated and tested your Rules, deploy them to production.
Use the following commands to selectively deploy your Rules alone or
deploy them as part of your normal deployment process.

Use the Firebase console

Edit and update your rules

Database: Select a database, then click Rules to navigate to the
Rules editor.

Storage: Click Rules to navigate to the Rules editor.

Edit your rules directly in the editor.

Note:When you
deploy security rules using the Firebase CLI,
the rules defined in your project directory overwrite any existing rules in the
Firebase console. So, if you choose to define or edit your security rules
using the Firebase console, make sure that you also update the rules defined
in your project directory.

Test your updates

You can test your Rules behavior directly in the Firebase console,
using the Rules simulator. Open the Simulator
screen in the Rules editor, modify the settings and click Run.
Look for the confirmation message at the top of the editor.

Deploy your updates

Once you're satisfied that your updates are what you expect, click Publish.