aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-12-21 15:26:37 +0000
committerMatthew Wild <mwild1@gmail.com>2010-12-21 15:26:37 +0000
commit5837f7565673ec5933bb4f528ee3289ea05d0744 (patch)
treec65e6ce012819992b2222c7522ce1b537c0e42d1 /util
parentdef542a8fe114a9f09ff54864b7702d9b1eebf1f (diff)
downloadprosody-5837f7565673ec5933bb4f528ee3289ea05d0744.tar.gz
prosody-5837f7565673ec5933bb4f528ee3289ea05d0744.zip
util.pubsub: Add service:set_node_capabilities()
Diffstat (limited to 'util')
-rw-r--r--util/pubsub.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/util/pubsub.lua b/util/pubsub.lua
index 1363bcb5..657dcd9a 100644
--- a/util/pubsub.lua
+++ b/util/pubsub.lua
@@ -242,4 +242,19 @@ function service:get_nodes(actor)
return true, self.nodes;
end
+-- Access models only affect 'none' affiliation caps, service/default access level...
+function service:set_node_capabilities(node, actor, capabilities)
+ -- Access checking
+ if not self:may(node, actor, "configure") then
+ return false, "forbidden";
+ end
+ --
+ local node_obj = self.nodes[node];
+ if not node_obj then
+ return false, "item-not-found";
+ end
+ node_obj.capabilities = capabilities;
+ return true;
+end
+
return _M;