aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/pubsub.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/util/pubsub.lua b/util/pubsub.lua
index f9255a55..b1aad71f 100644
--- a/util/pubsub.lua
+++ b/util/pubsub.lua
@@ -598,6 +598,18 @@ function service:set_node_config(node, actor, new_config)
end
end
+ if old_config["access_model"] ~= node_obj.config["access_model"] then
+ for subscriber in pairs(node_obj.subscribers) do
+ if not self:may(node, subscriber, "be_subscribed") then
+ local ok, err = self:remove_subscription(node, true, subscriber);
+ if not ok then
+ node_obj.config = old_config;
+ return ok, err;
+ end
+ end
+ end
+ end
+
if old_config["persist_items"] ~= node_obj.config["persist_items"] then
self.data[node] = self.config.itemstore(self.nodes[node].config, node);
elseif old_config["max_items"] ~= node_obj.config["max_items"] then