@edgedev/firebase 1.7.4 → 1.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/edgeFirebase.ts +22 -0
- package/images/default-collection-roles.png +0 -0
- package/images/root-collection-roles-old.png +0 -0
- package/images/root-collection-roles.png +0 -0
- package/images/root-user.png +0 -0
- package/package.json +1 -1
- /package/images/{root-user.jpg → root-user-old.jpg} +0 -0
package/README.md
CHANGED
|
@@ -374,12 +374,13 @@ Remove a role from a user for a collection:
|
|
|
374
374
|
|
|
375
375
|
### Root permissions and first user
|
|
376
376
|
|
|
377
|
-
You can assign a user access to all collections in the entire project by giving them a role on "-", which is used to define the root collection path. This would be for someone who is acting like a super admin. If this is your first user, you will need to manually set them up in the Firstore console. Once a root user is added manually you can use this user to add other "root users" or setup other collections and assign roles to them.
|
|
377
|
+
You can assign a user access to all collections in the entire project by giving them a role on "-", which is used to define the root collection path. This would be for someone who is acting like a super admin. If this is your first user, you will need to manually set them up in the Firstore console inside the "staged-users". Once a root user is added manually, you will need to "Register" that user using the docId of the "staged user" as the registration code, please see the user registration section of this documentation. You can use this user to add other "root users" or setup other collections and assign roles to them. You will also need to manually create the collection-data/-default- role permissions document (mentioned above) and the root permission document, see examples below:
|
|
378
378
|
|
|
379
|
-
|
|
380
|
-
| ------------------------------------------------------------ | ------------------------------------ |
|
|
379
|
+

|
|
381
380
|
|
|
381
|
+

|
|
382
382
|
|
|
383
|
+

|
|
383
384
|
|
|
384
385
|
### User special permissions
|
|
385
386
|
|
package/edgeFirebase.ts
CHANGED
|
@@ -1535,6 +1535,28 @@ export const EdgeFirebase = class {
|
|
|
1535
1535
|
}
|
|
1536
1536
|
};
|
|
1537
1537
|
|
|
1538
|
+
//TODO: Add documentation for this function
|
|
1539
|
+
public storeDocRaw = async (
|
|
1540
|
+
collectionPath: string,
|
|
1541
|
+
item: object,
|
|
1542
|
+
docId?: string,
|
|
1543
|
+
): Promise<actionResponse> => {
|
|
1544
|
+
const cloneItem = JSON.parse(JSON.stringify(item));
|
|
1545
|
+
if (docId !== undefined) {
|
|
1546
|
+
await setDoc( doc(this.db, collectionPath, docId), cloneItem);
|
|
1547
|
+
} else {
|
|
1548
|
+
await addDoc(
|
|
1549
|
+
collection(this.db, collectionPath),
|
|
1550
|
+
cloneItem
|
|
1551
|
+
);
|
|
1552
|
+
}
|
|
1553
|
+
return this.sendResponse({
|
|
1554
|
+
success: true,
|
|
1555
|
+
message: "",
|
|
1556
|
+
meta: {}
|
|
1557
|
+
});
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1538
1560
|
|
|
1539
1561
|
public storeDoc = async (
|
|
1540
1562
|
collectionPath: string,
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
File without changes
|