mirror of
https://github.com/appy-one/acebase-server.git
synced 2026-05-24 22:01:28 -06:00
[GH-ISSUE #104] Authorization rules semantics #30
Labels
No labels
bug
enhancement
feature request
pull-request
types
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/acebase-server#30
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pkaminski on GitHub (Mar 9, 2024).
Original GitHub issue: https://github.com/appy-one/acebase-server/issues/104
I'm trying to port an application from Firebase to AceBase and I'm having trouble migrating the authorization (security) rules:
newDatavariable references the prospective state of the entire database should the write operation being checked go through. While it points to the current property by default, it's possible to usechild()andparent()to access any value in the database whether it was part of the write or not. It looks like AceBase usesdatafor this instead but it only holds the values updated as part of the operation, so if we expect differently structured operations at a given location then we must manually check whether a new value is in fact being written and fall back to old data if not in our.validaterules.rootanddatavariables allow synchronous access to the current state of the entire database; any values obtained through them are guaranteed to represent a single state of the database during the execution of all rules leading up to either applying or rejecting the operation. The equivalent in AceBase appears to be the asyncvalue()function, but it's not clear whether the database could be mutated by concurrent requests while waiting forvalue()to return, either within a rule or between rules for a single operation.If my understanding above is correct, then:
data/newData, even if not using that exact syntax?value()won't be mutated until the operation is either applied or rejected?Thanks.
(cc @fahhem)