Merge branch 'feature/draft-apps' into admin/user-management-ui
This commit is contained in:
commit
9329644cf5
|
@ -147,7 +147,9 @@ exports.getRoleParams = (roleId = null, otherProps = {}) => {
|
|||
exports.getAllApps = async (devApps = false) => {
|
||||
const CouchDB = getCouch()
|
||||
let allDbs = await CouchDB.allDbs()
|
||||
const appDbNames = allDbs.filter(dbName => dbName.startsWith(exports.APP_PREFIX))
|
||||
const appDbNames = allDbs.filter(dbName =>
|
||||
dbName.startsWith(exports.APP_PREFIX)
|
||||
)
|
||||
const appPromises = appDbNames.map(db => new CouchDB(db).get(db))
|
||||
if (appPromises.length === 0) {
|
||||
return []
|
||||
|
|
|
@ -1,7 +1,12 @@
|
|||
const { getDB } = require("../db")
|
||||
const { cloneDeep } = require("lodash/fp")
|
||||
const { BUILTIN_PERMISSION_IDS, higherPermission } = require("./permissions")
|
||||
const { generateRoleID, getRoleParams, DocumentTypes, SEPARATOR } = require("../db/utils")
|
||||
const {
|
||||
generateRoleID,
|
||||
getRoleParams,
|
||||
DocumentTypes,
|
||||
SEPARATOR,
|
||||
} = require("../db/utils")
|
||||
|
||||
const BUILTIN_IDS = {
|
||||
ADMIN: "ADMIN",
|
||||
|
|
|
@ -20,10 +20,7 @@ const {
|
|||
DocumentTypes,
|
||||
AppStatus,
|
||||
} = require("../../db/utils")
|
||||
const {
|
||||
BUILTIN_ROLE_IDS,
|
||||
AccessController,
|
||||
} = require("@budibase/auth/roles")
|
||||
const { BUILTIN_ROLE_IDS, AccessController } = require("@budibase/auth/roles")
|
||||
const { BASE_LAYOUTS } = require("../../constants/layouts")
|
||||
const {
|
||||
createHomeScreen,
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
const Router = require("@koa/router")
|
||||
const controller = require("../controllers/permission")
|
||||
const authorized = require("../../middleware/authorized")
|
||||
const {
|
||||
BUILDER,
|
||||
PermissionLevels,
|
||||
} = require("@budibase/auth/permissions")
|
||||
const { BUILDER, PermissionLevels } = require("@budibase/auth/permissions")
|
||||
const Joi = require("joi")
|
||||
const joiValidator = require("../../middleware/joi-validator")
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
const { BUILTIN_ROLE_IDS } = require("@budibase/auth/roles")
|
||||
const {
|
||||
BUILTIN_PERMISSION_IDS,
|
||||
} = require("@budibase/auth/permissions")
|
||||
const { BUILTIN_PERMISSION_IDS } = require("@budibase/auth/permissions")
|
||||
const { createHomeScreen } = require("../../constants/screens")
|
||||
const { EMPTY_LAYOUT } = require("../../constants/layouts")
|
||||
const { cloneDeep } = require("lodash/fp")
|
||||
|
|
|
@ -4,10 +4,7 @@ const {
|
|||
getBuiltinPermissionByID,
|
||||
isPermissionLevelHigherThanRead,
|
||||
} = require("@budibase/auth/permissions")
|
||||
const {
|
||||
lowerBuiltinRoleID,
|
||||
getBuiltinRoles,
|
||||
} = require("@budibase/auth/roles")
|
||||
const { lowerBuiltinRoleID, getBuiltinRoles } = require("@budibase/auth/roles")
|
||||
const { DocumentTypes } = require("../db/utils")
|
||||
|
||||
const CURRENTLY_SUPPORTED_LEVELS = [
|
||||
|
|
|
@ -19,6 +19,6 @@ exports.fetch = async ctx => {
|
|||
exports.find = async ctx => {
|
||||
const appId = ctx.params.appId
|
||||
ctx.body = {
|
||||
roles: await getAllRoles(appId)
|
||||
roles: await getAllRoles(appId),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ const controller = require("../../controllers/admin/roles")
|
|||
|
||||
const router = Router()
|
||||
|
||||
|
||||
router
|
||||
.get("/api/admin/roles", controller.fetch)
|
||||
.get("/api/admin/roles/:appId", controller.find)
|
||||
|
|
|
@ -4,6 +4,7 @@ const groupRoutes = require("./admin/groups")
|
|||
const templateRoutes = require("./admin/templates")
|
||||
const emailRoutes = require("./admin/email")
|
||||
const authRoutes = require("./admin/auth")
|
||||
const roleRoutes = require("./admin/roles")
|
||||
const appRoutes = require("./app")
|
||||
|
||||
exports.routes = [
|
||||
|
@ -14,4 +15,5 @@ exports.routes = [
|
|||
appRoutes,
|
||||
templateRoutes,
|
||||
emailRoutes,
|
||||
roleRoutes,
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue