Abu Saeed
Abu Saeed

Reputation: 1170

Can I use cloud function in storage rule?

Since there is no way to find size of a folder directly in rule, I have made a function which will determine the size of a file(in folder xxx) add that size to a child(xxx) in realtime database. Using this value, I can block user from adding data inside child (xxx) in realtime database. Since it is not possible to use to realtime database directly in storage rule. Can I call a function from storage rule which will check the child(xxx) in realtime database and return true or false based on the value
blurred part is child name(xxx)

Upvotes: 0

Views: 34

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 599726

Security rules run in full isolation. There currently is no way to access other Firebase services from within the security rules of Cloud Storage.

It is a valid and common request though, so I recommend filing a feature request.

Upvotes: 1

Related Questions