@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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @iservice365/core
|
|
2
2
|
|
|
3
|
+
## 3.139.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 45755c1: Security: a membership that was taken away ("inactive" after the service-provider Repair or Finish-setup Undo, or "deleted") no longer grants organisation, site or role reach (resolveInviteActor, camera site entitlement, role-holder check).
|
|
8
|
+
|
|
3
9
|
## 3.139.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/dist/index.js
CHANGED
|
@@ -4402,6 +4402,7 @@ function pickLookupMembership(rows, type, site = "", org = "") {
|
|
|
4402
4402
|
return preferWorkingMembership(list.filter((m) => sameAppType(m.type, type)));
|
|
4403
4403
|
}
|
|
4404
4404
|
var WORKING = /* @__PURE__ */ new Set(["active", "approved"]);
|
|
4405
|
+
var TAKEN_AWAY_MEMBER_STATUSES = ["deleted", "inactive"];
|
|
4405
4406
|
function preferWorkingMembership(rows, defaultOrg = "") {
|
|
4406
4407
|
const list = Array.isArray(rows) ? rows : [];
|
|
4407
4408
|
const working = list.filter((m) => WORKING.has(String(m.status ?? "")) && !m.deletedAt);
|
|
@@ -5255,7 +5256,7 @@ function useMemberRepo() {
|
|
|
5255
5256
|
// sets it inactive, removal deletes it) must not keep the organisation
|
|
5256
5257
|
// on the person's list: latitude.sec@ still saw JLL Singapore beside its
|
|
5257
5258
|
// own company after the repair (owner report 2026-09-30).
|
|
5258
|
-
status: { $nin:
|
|
5259
|
+
status: { $nin: TAKEN_AWAY_MEMBER_STATUSES }
|
|
5259
5260
|
};
|
|
5260
5261
|
const cacheOptions = {
|
|
5261
5262
|
page: page2,
|
|
@@ -9905,7 +9906,7 @@ async function resolveInviteActor(userId) {
|
|
|
9905
9906
|
const db2 = import_node_server_utils28.useAtlas.getDb();
|
|
9906
9907
|
if (!db2)
|
|
9907
9908
|
return { ...EMPTY, id };
|
|
9908
|
-
const members = await db2.collection("members").find({ user: new import_mongodb26.ObjectId(id), status: { $
|
|
9909
|
+
const members = await db2.collection("members").find({ user: new import_mongodb26.ObjectId(id), status: { $nin: TAKEN_AWAY_MEMBER_STATUSES } }).toArray();
|
|
9909
9910
|
const adminMember = members.find((m) => m.type === "admin");
|
|
9910
9911
|
let isSuperAdmin2 = false;
|
|
9911
9912
|
let staffPermissions;
|
|
@@ -10212,7 +10213,7 @@ async function holdsRole(userId, roleId, orgId) {
|
|
|
10212
10213
|
const member = await db2.collection("members").findOne({
|
|
10213
10214
|
user: new import_mongodb26.ObjectId(id),
|
|
10214
10215
|
role: new import_mongodb26.ObjectId(role),
|
|
10215
|
-
status: { $
|
|
10216
|
+
status: { $nin: TAKEN_AWAY_MEMBER_STATUSES },
|
|
10216
10217
|
// both shapes, as `hasOrgInvitation` does for `metadata.org`
|
|
10217
10218
|
...org ? { org: { $in: [new import_mongodb26.ObjectId(org), org] } } : {}
|
|
10218
10219
|
});
|
|
@@ -23243,7 +23244,7 @@ function useCameraViewService() {
|
|
|
23243
23244
|
}
|
|
23244
23245
|
}
|
|
23245
23246
|
async function resolveSiteAccess(params) {
|
|
23246
|
-
const memberships = await params.db.collection("members").find({ user: new import_mongodb52.ObjectId(params.userId), status: { $
|
|
23247
|
+
const memberships = await params.db.collection("members").find({ user: new import_mongodb52.ObjectId(params.userId), status: { $nin: TAKEN_AWAY_MEMBER_STATUSES } }).project({ siteId: 1, org: 1, role: 1, type: 1 }).toArray();
|
|
23247
23248
|
const memberOrgIds = [
|
|
23248
23249
|
...new Map(
|
|
23249
23250
|
memberships.filter((membership) => membership.org).map((membership) => [String(membership.org), membership.org])
|