@edgedev/firebase 1.6.2 → 1.6.3
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/edgeFirebase.ts +1 -56
- package/package.json +1 -1
package/edgeFirebase.ts
CHANGED
|
@@ -745,64 +745,9 @@ export const EdgeFirebase = class {
|
|
|
745
745
|
|
|
746
746
|
// Simple Store Items (add matching key per firebase collection)
|
|
747
747
|
public data: CollectionDataObject = reactive({});
|
|
748
|
-
private usersByCollections: CollectionDataObject = reactive({});
|
|
749
|
-
|
|
750
|
-
public users = computed(() => {
|
|
751
|
-
const userList = {};
|
|
752
|
-
const keys = Object.keys(JSON.parse(JSON.stringify(this.usersByCollections)));
|
|
753
|
-
keys.forEach(key => {
|
|
754
|
-
const users = this.usersByCollections[key];
|
|
755
|
-
if (key.startsWith("ROLES|")) {
|
|
756
|
-
const collectionPathCheck = key.replace("ROLES|", "")
|
|
757
|
-
const userKeys = Object.keys(users);
|
|
758
|
-
if (Object.keys(users).length > 0) {
|
|
759
|
-
userKeys.forEach(userKey => {
|
|
760
|
-
const user = users[userKey];
|
|
761
|
-
if (!Object.prototype.hasOwnProperty.call(userList, user.docId)) {
|
|
762
|
-
userList[user.email] = {
|
|
763
|
-
docId: user.docId,
|
|
764
|
-
email: user.email,
|
|
765
|
-
roles: [{collectionPath: collectionPathCheck, role: user.roles[collectionPathCheck].role }],
|
|
766
|
-
specialPermissions: [],
|
|
767
|
-
meta: user.meta,
|
|
768
|
-
last_updated: user.last_updated,
|
|
769
|
-
userId: user.userId,
|
|
770
|
-
uid: user.uid
|
|
771
|
-
}
|
|
772
|
-
} else {
|
|
773
|
-
userList[user.email].roles.push({ collectionPath: collectionPathCheck, role: user.roles[collectionPathCheck].role })
|
|
774
|
-
}
|
|
775
|
-
});
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
if (key.startsWith("SPECIALPERMISSIONS|")) {
|
|
779
|
-
const collectionPathCheck = key.replace("SPECIALPERMISSIONS|", "")
|
|
780
|
-
const userKeys = Object.keys(users);
|
|
781
|
-
if (Object.keys(users).length > 0) {
|
|
782
|
-
userKeys.forEach(userKey => {
|
|
783
|
-
const user = users[userKey];
|
|
784
|
-
if (!Object.prototype.hasOwnProperty.call(userList, user.docId)) {
|
|
785
|
-
userList[user.email] = {
|
|
786
|
-
docId: user.docId,
|
|
787
|
-
email: user.email,
|
|
788
|
-
roles: [],
|
|
789
|
-
specialPermissions: [{ collectionPath: collectionPathCheck, permissions: user.specialPermissions[collectionPathCheck].permissions }],
|
|
790
|
-
meta: user.meta,
|
|
791
|
-
last_updated: user.last_updated,
|
|
792
|
-
userId: user.userId,
|
|
793
|
-
uid: user.uid
|
|
794
|
-
}
|
|
795
|
-
} else {
|
|
796
|
-
userList[user.email].specialPermissions.push({ collectionPath: collectionPathCheck, permissions: user.specialPermissions[collectionPathCheck].permissions })
|
|
797
|
-
}
|
|
798
|
-
});
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
|
-
});
|
|
802
|
-
return userList;
|
|
803
|
-
});
|
|
804
748
|
|
|
805
749
|
public unsubscibe: CollectionUnsubscribeObject = reactive({});
|
|
750
|
+
|
|
806
751
|
public user: UserDataObject = reactive({
|
|
807
752
|
uid: null,
|
|
808
753
|
email: "",
|