@budibase/server 2.7.7-alpha.8 → 2.7.7-alpha.9
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/automation.js +4 -1
- package/dist/automation.js.map +2 -2
- package/dist/index.js +5 -2
- package/dist/index.js.map +2 -2
- package/dist/query.js +4 -1
- package/dist/query.js.map +2 -2
- package/package.json +8 -8
- package/src/api/controllers/role.ts +5 -5
- package/src/api/controllers/routing.ts +3 -3
- package/src/middleware/currentapp.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -9305,7 +9305,7 @@ function lowerBuiltinRoleID(roleId1, roleId2) {
|
|
|
9305
9305
|
}
|
|
9306
9306
|
return builtinRoleToNumber(roleId1) > builtinRoleToNumber(roleId2) ? roleId2 : roleId1;
|
|
9307
9307
|
}
|
|
9308
|
-
async function getRole(roleId) {
|
|
9308
|
+
async function getRole(roleId, opts) {
|
|
9309
9309
|
if (!roleId) {
|
|
9310
9310
|
return void 0;
|
|
9311
9311
|
}
|
|
@@ -9321,6 +9321,9 @@ async function getRole(roleId) {
|
|
|
9321
9321
|
role = Object.assign(role, dbRole);
|
|
9322
9322
|
role._id = getExternalRoleID(role._id);
|
|
9323
9323
|
} catch (err) {
|
|
9324
|
+
if (!isBuiltin(roleId) && (opts == null ? void 0 : opts.defaultPublic)) {
|
|
9325
|
+
return cloneDeep2(BUILTIN_ROLES.PUBLIC);
|
|
9326
|
+
}
|
|
9324
9327
|
if (Object.keys(role).length === 0) {
|
|
9325
9328
|
throw err;
|
|
9326
9329
|
}
|
|
@@ -20738,7 +20741,7 @@ var init_currentapp = __esm({
|
|
|
20738
20741
|
userId,
|
|
20739
20742
|
globalId,
|
|
20740
20743
|
roleId,
|
|
20741
|
-
role: await roles_exports.getRole(roleId)
|
|
20744
|
+
role: await roles_exports.getRole(roleId, { defaultPublic: true })
|
|
20742
20745
|
};
|
|
20743
20746
|
}
|
|
20744
20747
|
return next();
|