@oondemand/oon-core-back 0.4.26 → 0.4.27
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 +1 -1
- package/src/core/rbac/storage.js +7 -2
package/package.json
CHANGED
package/src/core/rbac/storage.js
CHANGED
|
@@ -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
|
-
?
|
|
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:
|
|
193
|
+
permissions: unique([
|
|
194
|
+
...rolePermissions(authenticatedRole),
|
|
195
|
+
...globalPermissions,
|
|
196
|
+
]),
|
|
192
197
|
mustChangePassword: Boolean(user?.mustChangePassword || user?.firstAccessPending),
|
|
193
198
|
};
|
|
194
199
|
}
|