2020-03-24 11:56:48 +01:00
|
|
|
const StatusCodes = require("../../utilities/statusCodes")
|
|
|
|
|
|
|
|
module.exports = async ctx => {
|
2020-03-27 16:14:50 +01:00
|
|
|
const existingAccessLevels = await ctx.instance.authApi.loadAccessLevels()
|
2020-03-27 15:49:43 +01:00
|
|
|
const accessLevels = ctx.request.body.accessLevels
|
2020-03-27 16:14:50 +01:00
|
|
|
accessLevels.version = existingAccessLevels.version
|
2020-03-27 15:49:43 +01:00
|
|
|
await ctx.instance.authApi.saveAccessLevels(accessLevels)
|
2020-03-24 11:56:48 +01:00
|
|
|
await ctx.instance.templateApi.upgradeData(ctx.request.body.newHierarchy)
|
2020-03-28 07:39:22 +01:00
|
|
|
await ctx.master.clearAllSessions(ctx.params.appname)
|
2020-03-24 11:56:48 +01:00
|
|
|
ctx.response.status = StatusCodes.OK
|
|
|
|
}
|