Formatting.

This commit is contained in:
mike12345567 2021-05-14 16:32:51 +01:00
parent c45fdefb48
commit ac0f620b38
9 changed files with 16 additions and 21 deletions

View File

@ -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 []

View File

@ -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",

View File

@ -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,

View File

@ -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")

View File

@ -14,7 +14,7 @@ exports.getAllTableRows = async config => {
}
exports.clearAllApps = async () => {
const req = { query: { status: "dev"} }
const req = { query: { status: "dev" } }
await appController.fetch(req)
const apps = req.body
if (!apps || apps.length <= 0) {

View File

@ -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")

View File

@ -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 = [

View File

@ -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),
}
}

View File

@ -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)