Merge pull request #14864 from Budibase/chore/allow-overriding-minversion-without-power-role
Allow overriding the min version where we stop serving the power role
This commit is contained in:
commit
08ee84c88b
|
@ -223,6 +223,8 @@ const environment = {
|
|||
BB_ADMIN_USER_EMAIL: process.env.BB_ADMIN_USER_EMAIL,
|
||||
BB_ADMIN_USER_PASSWORD: process.env.BB_ADMIN_USER_PASSWORD,
|
||||
OPENAI_API_KEY: process.env.OPENAI_API_KEY,
|
||||
MIN_VERSION_WITHOUT_POWER_ROLE:
|
||||
process.env.MIN_VERSION_WITHOUT_POWER_ROLE || "3.0.0",
|
||||
}
|
||||
|
||||
export function setEnv(newEnvVars: Partial<typeof environment>): () => void {
|
||||
|
|
|
@ -19,6 +19,7 @@ import {
|
|||
import cloneDeep from "lodash/fp/cloneDeep"
|
||||
import { RoleColor, helpers } from "@budibase/shared-core"
|
||||
import { uniqBy } from "lodash"
|
||||
import { default as env } from "../environment"
|
||||
|
||||
export const BUILTIN_ROLE_IDS = {
|
||||
ADMIN: "ADMIN",
|
||||
|
@ -545,7 +546,10 @@ async function shouldIncludePowerRole(db: Database) {
|
|||
return true
|
||||
}
|
||||
|
||||
const isGreaterThan3x = semver.gte(creationVersion, "3.0.0")
|
||||
const isGreaterThan3x = semver.gte(
|
||||
creationVersion,
|
||||
env.MIN_VERSION_WITHOUT_POWER_ROLE
|
||||
)
|
||||
return !isGreaterThan3x
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,9 @@
|
|||
$: buttonLabel = readableRole ? `Access: ${readableRole}` : "Access"
|
||||
$: highlight = roleMismatch || selectedRole === Roles.PUBLIC
|
||||
|
||||
$: builtInRoles = builtins.map(roleId => $roles.find(x => x._id === roleId))
|
||||
$: builtInRoles = builtins
|
||||
.map(roleId => $roles.find(x => x._id === roleId))
|
||||
.filter(r => !!r)
|
||||
$: customRoles = $roles
|
||||
.filter(x => !builtins.includes(x._id))
|
||||
.slice()
|
||||
|
|
Loading…
Reference in New Issue