write access levels

This commit is contained in:
Martin McKeaveney 2020-03-27 14:49:43 +00:00
parent 6cd08c32a5
commit ca026e6017
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
}