@oondemand/oon-core-back 0.4.26 → 0.4.28

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oondemand/oon-core-back",
3
- "version": "0.4.26",
3
+ "version": "0.4.28",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/oondemand/oon-platform.git",
@@ -9,6 +9,7 @@ const {
9
9
  policy,
10
10
  roleByCode,
11
11
  rolePermissions,
12
+ unique,
12
13
  legacyPermissions,
13
14
  matchingRoleForLegacyUser,
14
15
  } = require("./policy");
@@ -182,13 +183,17 @@ async function resolveUserAccess(user, { touch = true } = {}) {
182
183
  (ctx.config.accessMode || ctx.config.ecosystem?.accessMode) === "authenticated_users";
183
184
  if (!access && authenticatedAdmission) {
184
185
  const globalPermissions = Array.isArray(user?.globalPermissions)
185
- ? [...new Set(user.globalPermissions.map(String))]
186
+ ? user.globalPermissions.map(String)
186
187
  : [];
188
+ const authenticatedRole = roleByCode("authenticated_user");
187
189
  return {
188
190
  mode: "authenticated_users",
189
191
  status: "active",
190
192
  roleCode: "authenticated_user",
191
- permissions: globalPermissions,
193
+ permissions: unique([
194
+ ...rolePermissions(authenticatedRole),
195
+ ...globalPermissions,
196
+ ]),
192
197
  mustChangePassword: Boolean(user?.mustChangePassword || user?.firstAccessPending),
193
198
  };
194
199
  }