@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.
@@ -9026,7 +9026,7 @@ function lowerBuiltinRoleID(roleId1, roleId2) {
9026
9026
  }
9027
9027
  return builtinRoleToNumber(roleId1) > builtinRoleToNumber(roleId2) ? roleId2 : roleId1;
9028
9028
  }
9029
- async function getRole(roleId) {
9029
+ async function getRole(roleId, opts) {
9030
9030
  if (!roleId) {
9031
9031
  return void 0;
9032
9032
  }
@@ -9042,6 +9042,9 @@ async function getRole(roleId) {
9042
9042
  role = Object.assign(role, dbRole);
9043
9043
  role._id = getExternalRoleID(role._id);
9044
9044
  } catch (err) {
9045
+ if (!isBuiltin(roleId) && (opts == null ? void 0 : opts.defaultPublic)) {
9046
+ return cloneDeep2(BUILTIN_ROLES.PUBLIC);
9047
+ }
9045
9048
  if (Object.keys(role).length === 0) {
9046
9049
  throw err;
9047
9050
  }