Fixing minor bug with permission add.
This commit is contained in:
parent
c8ef404560
commit
2103378e5c
|
@ -71,10 +71,11 @@ async function updatePermissionOnRole(
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = await db.bulkDocs(docUpdates)
|
const response = await db.bulkDocs(docUpdates)
|
||||||
return response.map(resp => ({
|
return response.map(resp => {
|
||||||
...resp,
|
resp._id = getExternalRoleID(resp.id)
|
||||||
_id: getExternalRoleID(resp._id),
|
delete resp.id
|
||||||
}))
|
return resp
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.fetchBuiltin = function(ctx) {
|
exports.fetchBuiltin = function(ctx) {
|
||||||
|
|
|
@ -47,6 +47,7 @@ router.use(async (ctx, next) => {
|
||||||
message: err.message,
|
message: err.message,
|
||||||
status: ctx.status,
|
status: ctx.status,
|
||||||
}
|
}
|
||||||
|
console.trace(err)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ describe("/permission", () => {
|
||||||
describe("test", () => {
|
describe("test", () => {
|
||||||
it("should be able to add permission to a role for the table", async () => {
|
it("should be able to add permission to a role for the table", async () => {
|
||||||
expect(perms.length).toEqual(1)
|
expect(perms.length).toEqual(1)
|
||||||
expect(perms[0].id).toEqual(`${STD_ROLE_ID}`)
|
expect(perms[0]._id).toEqual(`${STD_ROLE_ID}`)
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should get the resource permissions", async () => {
|
it("should get the resource permissions", async () => {
|
||||||
|
|
Loading…
Reference in New Issue