From 499351fd1c1e7c1462df9a962e927fb4dba6b594 Mon Sep 17 00:00:00 2001 From: Kaarle Ritvanen Date: Mon, 24 Mar 2014 02:54:06 +0200 Subject: model: ignore private Model fields/methods when fetching objects --- aconf/model/model.lua | 2 +- aconf/model/node.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'aconf') diff --git a/aconf/model/model.lua b/aconf/model/model.lua index e71e73c..3f90450 100644 --- a/aconf/model/model.lua +++ b/aconf/model/model.lua @@ -170,7 +170,7 @@ function M.Model:init(context) end end - return v + if options.private then return v end end if self.is_removable then diff --git a/aconf/model/node.lua b/aconf/model/node.lua index 741aaeb..92f3a1f 100644 --- a/aconf/model/node.lua +++ b/aconf/model/node.lua @@ -152,7 +152,7 @@ function M.TreeNode:init(context, params) if not mt.txn then return end function mt.save(k, v) rawset(self, k, v) end - function mt.__index(t, k) return mt.get(k) end + function mt.__index(t, k) return mt.get(k, {private=true}) end function mt.__newindex(t, k, v) mt.save(k, v) end function mt.has_permission(user, permission) -- cgit v1.2.3