Open
Description
Today a user must ensure that policy rules cover the cases of anonymous users (where auth()
evaluates to null). This can be not obvious when comparing auth()
with other (nullable) fields. E.g.:
@@allow('all', owner == auth())
If owner
field is nullable, anonymous users are effectively granted full access to the entity, which may not be the intention.
@sidharthv96 suggests that at compile time, we detect the cases where policy rules pass for anonymous users and report errors. Users can explicitly suppress the errors with some kind of special comments (similar to how you suppress lint errors).