write access levels

This commit is contained in:
Martin McKeaveney 2020-03-27 14:49:43 +00:00
parent 220f128d84
commit 00eb3ce13a
2 changed files with 4 additions and 1 deletions

View File

@ -106,7 +106,7 @@ export const saveBackend = async state => {
for (let instance of instances_currentFirst) {
await api.post(
`/_builder/instance/${state.appname}/${instance.id}/api/upgradeData`,
{ newHierarchy: state.hierarchy }
{ newHierarchy: state.hierarchy, accessLevels: state.accessLevels }
)
}
}

View File

@ -1,6 +1,9 @@
const StatusCodes = require("../../utilities/statusCodes")
module.exports = async ctx => {
const accessLevels = ctx.request.body.accessLevels
accessLevels.version = 0
await ctx.instance.authApi.saveAccessLevels(accessLevels)
await ctx.instance.templateApi.upgradeData(ctx.request.body.newHierarchy)
ctx.response.status = StatusCodes.OK
}