summaryrefslogtreecommitdiffstats
path: root/acf/model/root.lua
blob: a786064c9be3489df50e8c5f0c014448fc709be0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--[[
Copyright (c) 2012-2013 Kaarle Ritvanen
See LICENSE file for license details
--]]

module(..., package.seeall)

local model = require('acf.model.model')
local super = require('acf.object').super


RootModel = model.new()

function RootModel:init(txn)
   super(self, RootModel):init{txn=txn, path='/', addr='/volatile'}
end

function RootModel:has_permission(user, permission)
   return permission == 'read'
end

function register(name, addr, field)
   RootModel[name] = model.to_field(field, addr)
end