@7365admin1/core 3.139.0 → 3.139.1
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/dist/index.mjs
CHANGED
|
@@ -3231,6 +3231,7 @@ function pickLookupMembership(rows, type, site = "", org = "") {
|
|
|
3231
3231
|
return preferWorkingMembership(list.filter((m) => sameAppType(m.type, type)));
|
|
3232
3232
|
}
|
|
3233
3233
|
var WORKING = /* @__PURE__ */ new Set(["active", "approved"]);
|
|
3234
|
+
var TAKEN_AWAY_MEMBER_STATUSES = ["deleted", "inactive"];
|
|
3234
3235
|
function preferWorkingMembership(rows, defaultOrg = "") {
|
|
3235
3236
|
const list = Array.isArray(rows) ? rows : [];
|
|
3236
3237
|
const working = list.filter((m) => WORKING.has(String(m.status ?? "")) && !m.deletedAt);
|
|
@@ -4094,7 +4095,7 @@ function useMemberRepo() {
|
|
|
4094
4095
|
// sets it inactive, removal deletes it) must not keep the organisation
|
|
4095
4096
|
// on the person's list: latitude.sec@ still saw JLL Singapore beside its
|
|
4096
4097
|
// own company after the repair (owner report 2026-09-30).
|
|
4097
|
-
status: { $nin:
|
|
4098
|
+
status: { $nin: TAKEN_AWAY_MEMBER_STATUSES }
|
|
4098
4099
|
};
|
|
4099
4100
|
const cacheOptions = {
|
|
4100
4101
|
page: page2,
|
|
@@ -8803,7 +8804,7 @@ async function resolveInviteActor(userId) {
|
|
|
8803
8804
|
const db2 = useAtlas17.getDb();
|
|
8804
8805
|
if (!db2)
|
|
8805
8806
|
return { ...EMPTY, id };
|
|
8806
|
-
const members = await db2.collection("members").find({ user: new ObjectId26(id), status: { $
|
|
8807
|
+
const members = await db2.collection("members").find({ user: new ObjectId26(id), status: { $nin: TAKEN_AWAY_MEMBER_STATUSES } }).toArray();
|
|
8807
8808
|
const adminMember = members.find((m) => m.type === "admin");
|
|
8808
8809
|
let isSuperAdmin2 = false;
|
|
8809
8810
|
let staffPermissions;
|
|
@@ -9110,7 +9111,7 @@ async function holdsRole(userId, roleId, orgId) {
|
|
|
9110
9111
|
const member = await db2.collection("members").findOne({
|
|
9111
9112
|
user: new ObjectId26(id),
|
|
9112
9113
|
role: new ObjectId26(role),
|
|
9113
|
-
status: { $
|
|
9114
|
+
status: { $nin: TAKEN_AWAY_MEMBER_STATUSES },
|
|
9114
9115
|
// both shapes, as `hasOrgInvitation` does for `metadata.org`
|
|
9115
9116
|
...org ? { org: { $in: [new ObjectId26(org), org] } } : {}
|
|
9116
9117
|
});
|
|
@@ -22242,7 +22243,7 @@ function useCameraViewService() {
|
|
|
22242
22243
|
}
|
|
22243
22244
|
}
|
|
22244
22245
|
async function resolveSiteAccess(params) {
|
|
22245
|
-
const memberships = await params.db.collection("members").find({ user: new ObjectId52(params.userId), status: { $
|
|
22246
|
+
const memberships = await params.db.collection("members").find({ user: new ObjectId52(params.userId), status: { $nin: TAKEN_AWAY_MEMBER_STATUSES } }).project({ siteId: 1, org: 1, role: 1, type: 1 }).toArray();
|
|
22246
22247
|
const memberOrgIds = [
|
|
22247
22248
|
...new Map(
|
|
22248
22249
|
memberships.filter((membership) => membership.org).map((membership) => [String(membership.org), membership.org])
|