@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/query.js CHANGED
@@ -10775,7 +10775,7 @@ function lowerBuiltinRoleID(roleId1, roleId2) {
10775
10775
  }
10776
10776
  return builtinRoleToNumber(roleId1) > builtinRoleToNumber(roleId2) ? roleId2 : roleId1;
10777
10777
  }
10778
- async function getRole(roleId) {
10778
+ async function getRole(roleId, opts) {
10779
10779
  if (!roleId) {
10780
10780
  return void 0;
10781
10781
  }
@@ -10791,6 +10791,9 @@ async function getRole(roleId) {
10791
10791
  role = Object.assign(role, dbRole);
10792
10792
  role._id = getExternalRoleID(role._id);
10793
10793
  } catch (err) {
10794
+ if (!isBuiltin(roleId) && (opts == null ? void 0 : opts.defaultPublic)) {
10795
+ return cloneDeep2(BUILTIN_ROLES.PUBLIC);
10796
+ }
10794
10797
  if (Object.keys(role).length === 0) {
10795
10798
  throw err;
10796
10799
  }