Merge branch 'master' of github.com:Budibase/budibase into fix/post-release-fixes
This commit is contained in:
commit
6c2e4d8b4b
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"version": "0.9.154-alpha.1",
|
||||
"version": "0.9.156",
|
||||
"npmClient": "yarn",
|
||||
"packages": [
|
||||
"packages/*"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/auth",
|
||||
"version": "0.9.154-alpha.1",
|
||||
"version": "0.9.156",
|
||||
"description": "Authentication middlewares for budibase builder and apps",
|
||||
"main": "src/index.js",
|
||||
"author": "Budibase",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@budibase/bbui",
|
||||
"description": "A UI solution used in the different Budibase projects.",
|
||||
"version": "0.9.154-alpha.1",
|
||||
"version": "0.9.156",
|
||||
"license": "AGPL-3.0",
|
||||
"svelte": "src/index.js",
|
||||
"module": "dist/bbui.es.js",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/builder",
|
||||
"version": "0.9.154-alpha.1",
|
||||
"version": "0.9.156",
|
||||
"license": "AGPL-3.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
@ -65,10 +65,10 @@
|
|||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@budibase/bbui": "^0.9.154-alpha.1",
|
||||
"@budibase/client": "^0.9.154-alpha.1",
|
||||
"@budibase/bbui": "^0.9.156",
|
||||
"@budibase/client": "^0.9.156",
|
||||
"@budibase/colorpicker": "1.1.2",
|
||||
"@budibase/string-templates": "^0.9.154-alpha.1",
|
||||
"@budibase/string-templates": "^0.9.156",
|
||||
"@sentry/browser": "5.19.1",
|
||||
"@spectrum-css/page": "^3.0.1",
|
||||
"@spectrum-css/vars": "^3.0.1",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/cli",
|
||||
"version": "0.9.154-alpha.1",
|
||||
"version": "0.9.156",
|
||||
"description": "Budibase CLI, for developers, self hosting and migrations.",
|
||||
"main": "src/index.js",
|
||||
"bin": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/client",
|
||||
"version": "0.9.154-alpha.1",
|
||||
"version": "0.9.156",
|
||||
"license": "MPL-2.0",
|
||||
"module": "dist/budibase-client.js",
|
||||
"main": "dist/budibase-client.js",
|
||||
|
@ -19,9 +19,9 @@
|
|||
"dev:builder": "rollup -cw"
|
||||
},
|
||||
"dependencies": {
|
||||
"@budibase/bbui": "^0.9.154-alpha.1",
|
||||
"@budibase/bbui": "^0.9.156",
|
||||
"@budibase/standard-components": "^0.9.139",
|
||||
"@budibase/string-templates": "^0.9.154-alpha.1",
|
||||
"@budibase/string-templates": "^0.9.156",
|
||||
"regexparam": "^1.3.0",
|
||||
"shortid": "^2.2.15",
|
||||
"svelte-spa-router": "^3.0.5"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@budibase/server",
|
||||
"email": "hi@budibase.com",
|
||||
"version": "0.9.154-alpha.1",
|
||||
"version": "0.9.156",
|
||||
"description": "Budibase Web Server",
|
||||
"main": "src/index.js",
|
||||
"repository": {
|
||||
|
@ -66,9 +66,9 @@
|
|||
"author": "Budibase",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"dependencies": {
|
||||
"@budibase/auth": "^0.9.154-alpha.1",
|
||||
"@budibase/client": "^0.9.154-alpha.1",
|
||||
"@budibase/string-templates": "^0.9.154-alpha.1",
|
||||
"@budibase/auth": "^0.9.156",
|
||||
"@budibase/client": "^0.9.156",
|
||||
"@budibase/string-templates": "^0.9.156",
|
||||
"@elastic/elasticsearch": "7.10.0",
|
||||
"@koa/router": "8.0.0",
|
||||
"@sendgrid/mail": "7.1.1",
|
||||
|
|
|
@ -4,9 +4,13 @@ const { Cookies } = require("@budibase/auth").constants
|
|||
const { getRole } = require("@budibase/auth/roles")
|
||||
const { BUILTIN_ROLE_IDS } = require("@budibase/auth/roles")
|
||||
const { generateUserMetadataID } = require("../db/utils")
|
||||
const { dbExists } = require("@budibase/auth/db")
|
||||
const { dbExists, getTenantIDFromAppID } = require("@budibase/auth/db")
|
||||
const { getTenantId } = require("@budibase/auth/tenancy")
|
||||
const { getCachedSelf } = require("../utilities/global")
|
||||
const CouchDB = require("../db")
|
||||
const env = require("../environment")
|
||||
|
||||
const DEFAULT_TENANT_ID = "default"
|
||||
|
||||
module.exports = async (ctx, next) => {
|
||||
// try to get the appID from the request
|
||||
|
@ -45,11 +49,21 @@ module.exports = async (ctx, next) => {
|
|||
// retrieving global user gets the right role
|
||||
roleId = globalUser.roleId || BUILTIN_ROLE_IDS.BASIC
|
||||
}
|
||||
|
||||
// nothing more to do
|
||||
if (!appId) {
|
||||
return next()
|
||||
}
|
||||
|
||||
// If user and app tenant Ids do not match, 403
|
||||
if (env.MULTI_TENANCY && ctx.user) {
|
||||
const userTenantId = getTenantId()
|
||||
const tenantId = getTenantIDFromAppID(appId) || DEFAULT_TENANT_ID
|
||||
if (tenantId !== userTenantId) {
|
||||
ctx.throw(403, "Cannot access application.")
|
||||
}
|
||||
}
|
||||
|
||||
ctx.appId = appId
|
||||
if (roleId) {
|
||||
ctx.roleId = roleId
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/string-templates",
|
||||
"version": "0.9.154-alpha.1",
|
||||
"version": "0.9.156",
|
||||
"description": "Handlebars wrapper for Budibase templating.",
|
||||
"main": "src/index.cjs",
|
||||
"module": "dist/bundle.mjs",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@budibase/worker",
|
||||
"email": "hi@budibase.com",
|
||||
"version": "0.9.154-alpha.1",
|
||||
"version": "0.9.156",
|
||||
"description": "Budibase background service",
|
||||
"main": "src/index.js",
|
||||
"repository": {
|
||||
|
@ -27,8 +27,8 @@
|
|||
"author": "Budibase",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"dependencies": {
|
||||
"@budibase/auth": "^0.9.154-alpha.1",
|
||||
"@budibase/string-templates": "^0.9.154-alpha.1",
|
||||
"@budibase/auth": "^0.9.156",
|
||||
"@budibase/string-templates": "^0.9.156",
|
||||
"@koa/router": "^8.0.0",
|
||||
"@techpass/passport-openidconnect": "^0.3.0",
|
||||
"aws-sdk": "^2.811.0",
|
||||
|
|
Loading…
Reference in New Issue