1 let XDate = require('xdate')
4 let get_account = await _require('/_lib/get_account.jst')
5 let get_session = await _require('/_lib/get_session.jst')
6 let post_request = await _require('/_lib/post_request.jst')
7 let Problem = await _require('/_lib/Problem.jst')
14 let transaction = await env.site.database.Transaction()
16 let account = await get_account(
19 await get_session(env, transaction)
21 if (account === undefined)
22 throw new Problem('Unauthorized', 'Please sign in first.', 401)
23 if (!await account.get_json('administrator'))
24 throw new Problem('Unauthorized', 'Not administrator.', 401)
26 globals = await (await transaction.get({})).get_json('globals', {})
28 await transaction.commit()
32 transaction.rollback()