summaryrefslogtreecommitdiffstats
path: root/acf/model/root.lua
diff options
context:
space:
mode:
Diffstat (limited to 'acf/model/root.lua')
-rw-r--r--acf/model/root.lua24
1 files changed, 24 insertions, 0 deletions
diff --git a/acf/model/root.lua b/acf/model/root.lua
new file mode 100644
index 0000000..a786064
--- /dev/null
+++ b/acf/model/root.lua
@@ -0,0 +1,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