Browse Source

default to public in UI

gh-pages
Martin McKeaveney 5 years ago
parent
commit
561f824606
  1. 2
      packages/auth/src/security/roles.js
  2. 2
      packages/builder/src/pages/builder/portal/manage/users/[userId].svelte

2
packages/auth/src/security/roles.js

@ -226,7 +226,7 @@ exports.getAllRoles = async appId => {
dbRole => exports.getExternalRoleID(dbRole._id) === builtinRoleId dbRole => exports.getExternalRoleID(dbRole._id) === builtinRoleId
)[0] )[0]
if (dbBuiltin == null) { if (dbBuiltin == null) {
roles.push(builtinRole || builtinRoles.PUBLIC) roles.push(builtinRole)
} else { } else {
// remove role and all back after combining with the builtin // remove role and all back after combining with the builtin
roles = roles.filter(role => role._id !== dbBuiltin._id) roles = roles.filter(role => role._id !== dbBuiltin._id)

2
packages/builder/src/pages/builder/portal/manage/users/[userId].svelte

@ -33,7 +33,7 @@
role: {}, role: {},
} }
$: defaultRoleId = $userFetch?.data?.builder?.global ? "ADMIN" : "" $: defaultRoleId = $userFetch?.data?.builder?.global ? "ADMIN" : "PUBLIC"
// Merge the Apps list and the roles response to get something that makes sense for the table // Merge the Apps list and the roles response to get something that makes sense for the table
$: appList = Object.keys($apps?.data).map(id => { $: appList = Object.keys($apps?.data).map(id => {
const role = $userFetch?.data?.roles?.[id] || defaultRoleId const role = $userFetch?.data?.roles?.[id] || defaultRoleId

Loading…
Cancel
Save