Fixing component definition test cases and fixing an issue found by authorized test case.
This commit is contained in:
parent
6d8f27ba4e
commit
62360b1025
|
@ -14,7 +14,7 @@ describe("/component", () => {
|
||||||
describe("fetch definitions", () => {
|
describe("fetch definitions", () => {
|
||||||
it("should be able to fetch definitions", async () => {
|
it("should be able to fetch definitions", async () => {
|
||||||
const res = await request
|
const res = await request
|
||||||
.get(`/${config.getAppId()}/components/definitions`)
|
.get(`/api/${config.getAppId()}/components/definitions`)
|
||||||
.set(config.defaultHeaders())
|
.set(config.defaultHeaders())
|
||||||
.expect("Content-Type", /json/)
|
.expect("Content-Type", /json/)
|
||||||
.expect(200)
|
.expect(200)
|
||||||
|
@ -25,7 +25,7 @@ describe("/component", () => {
|
||||||
await checkBuilderEndpoint({
|
await checkBuilderEndpoint({
|
||||||
config,
|
config,
|
||||||
method: "GET",
|
method: "GET",
|
||||||
url: `/${config.getAppId()}/components/definitions`,
|
url: `/api/${config.getAppId()}/components/definitions`,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -42,10 +42,6 @@ module.exports = (permType, permLevel = null) => async (ctx, next) => {
|
||||||
const isAdmin = ADMIN_ROLES.includes(role._id)
|
const isAdmin = ADMIN_ROLES.includes(role._id)
|
||||||
const isAuthed = ctx.auth.authenticated
|
const isAuthed = ctx.auth.authenticated
|
||||||
|
|
||||||
if (permType === PermissionTypes.BUILDER) {
|
|
||||||
return next()
|
|
||||||
}
|
|
||||||
|
|
||||||
const { basePermissions, permissions } = await getUserPermissions(
|
const { basePermissions, permissions } = await getUserPermissions(
|
||||||
ctx.appId,
|
ctx.appId,
|
||||||
role._id
|
role._id
|
||||||
|
|
Loading…
Reference in New Issue