Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- path /visits/{visit_id} is Visit {
- read() { canManageSpace(this.spaceId) }
- write() { canManageSpace(this.spaceId) }
- }
- path /spaceVisits/{space_id}/{visit_id} is Visit {
- read() { canManageSpace(space_id) }
- }
- path /memberVisits/{member_id}/{visit_id} is Visit {
- read() { canManageSpace(this.spaceId) }
- }
- type Visit {
- duration: UnsignedNumber | Null,
- in: UnsignedNumber,
- memberId: String,
- out: UnsignedNumber | Null,
- spaceId: String,
- validate() {
- (this.out === null || this.duration === (this.out - this.in))
- }
- }
- type UnsignedNumber extends Number {
- validate() { this >= 0 }
- }
- // Returns `true` if the value is initialized to init, or if it retains it's prior value, otherwise `false`
- isSignedIn() { auth !== null }
- isCurrentUser(uid) { isSignedIn() && auth.uid === uid }
- canManageSpace(id) {
- // Check that the user has proper credentials in your own logic
- isSignedIn()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement