-
Notifications
You must be signed in to change notification settings - Fork 585
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Complex Custom User Data Example (#6251)
Co-authored-by: Kenneth Geisshirt <[email protected]> Co-authored-by: LJ <[email protected]>
- Loading branch information
1 parent
8a9b9b4
commit f3159ab
Showing
41 changed files
with
635 additions
and
311 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
examples/rn-connection-and-error/backend/auth/custom_user_data.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
{ | ||
"enabled": true, | ||
"mongo_service_name": "mongodb-atlas", | ||
"database_name": "AuthExample", | ||
"database_name": "StoreDemo", | ||
"collection_name": "Users", | ||
"user_id_field": "user_id", | ||
"on_user_creation_function_name": "onUserCreation" | ||
"user_id_field": "userId" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 0 additions & 22 deletions
22
...s/rn-connection-and-error/backend/data_sources/mongodb-atlas/AuthExample/Users/rules.json
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...ngodb-atlas/sync/Kiosk/relationships.json → ...-atlas/StoreDemo/Kiosk/relationships.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...les/rn-connection-and-error/backend/data_sources/mongodb-atlas/StoreDemo/Kiosk/rules.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"database": "StoreDemo", | ||
"collection": "Kiosk", | ||
"roles": [ | ||
{ | ||
"name": "readAndWriteSpecificStore", | ||
"apply_when": {}, | ||
"document_filters": { | ||
"read": { | ||
"storeId": "%%user.custom_data.storeId" | ||
}, | ||
"write": { | ||
"storeId": "%%user.custom_data.storeId" | ||
} | ||
}, | ||
"insert": true, | ||
"delete": true, | ||
"search": true, | ||
"read": true, | ||
"write": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
23 changes: 23 additions & 0 deletions
23
...s/rn-connection-and-error/backend/data_sources/mongodb-atlas/StoreDemo/Product/rules.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"database": "StoreDemo", | ||
"collection": "Product", | ||
"roles": [ | ||
{ | ||
"name": "readAndWriteSpecificStore", | ||
"apply_when": {}, | ||
"document_filters": { | ||
"read": { | ||
"storeId": "%%user.custom_data.storeId" | ||
}, | ||
"write": { | ||
"storeId": "%%user.custom_data.storeId" | ||
} | ||
}, | ||
"insert": true, | ||
"delete": true, | ||
"search": true, | ||
"read": true, | ||
"write": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ngodb-atlas/sync/Store/relationships.json → ...-atlas/StoreDemo/Store/relationships.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...les/rn-connection-and-error/backend/data_sources/mongodb-atlas/StoreDemo/Store/rules.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"database": "StoreDemo", | ||
"collection": "Store", | ||
"roles": [ | ||
{ | ||
"name": "readAndWriteSpecificStore", | ||
"apply_when": {}, | ||
"document_filters": { | ||
"read": { | ||
"_id": "%%user.custom_data.storeId" | ||
}, | ||
"write": { | ||
"_id": "%%user.custom_data.storeId" | ||
} | ||
}, | ||
"insert": true, | ||
"delete": true, | ||
"search": true, | ||
"read": true, | ||
"write": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...les/rn-connection-and-error/backend/data_sources/mongodb-atlas/StoreDemo/Users/rules.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"database": "StoreDemo", | ||
"collection": "Users", | ||
"roles": [ | ||
{ | ||
"name": "ThisUser", | ||
"apply_when": { | ||
"userId": "%%user.id" | ||
}, | ||
"document_filters": { | ||
"read": true, | ||
"write": true | ||
}, | ||
"insert": true, | ||
"delete": true, | ||
"search": true, | ||
"read": true, | ||
"write": true | ||
} | ||
] | ||
} |
Oops, something went wrong.