O'Reilly logo

Hands-on Full Stack Development with Angular 5 and Firebase by Uttam Agarwal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding security rules for users

In our application, users' details play a critical part, so we need to provide security rules for our users' details. We have already seen the default settings for security. By default, only an authenticated user can access any part of our Firebase database. We will modify the security rules for the user node and retain the default security rules for the other nodes for now.

As you can see from the following screenshot, for users node, read and write operations are allowed for an authentic user with the same unique user ID; we will also need to validate the type of data in our user node to maintain the data integrity:

To validate the changes in our security rules, Firebase provides a simulator to test our ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required