aboutsummaryrefslogtreecommitdiffstats
path: root/util/pubsub.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-08-08 20:48:02 +0100
committerMatthew Wild <mwild1@gmail.com>2018-08-08 20:48:02 +0100
commitc5a1a67f455c87a5400e21b43b9c726db54e992e (patch)
treeb26b8face1963d8178c32409dbcd5199e8b8533f /util/pubsub.lua
parentcaf9924d3424ab933c02dddaee0fa9a4e577c504 (diff)
downloadprosody-c5a1a67f455c87a5400e21b43b9c726db54e992e.tar.gz
prosody-c5a1a67f455c87a5400e21b43b9c726db54e992e.zip
mod_pubsub, mod_pep, util.pubsub: Move capability definitions into util.pubsub to avoid duplication
Diffstat (limited to 'util/pubsub.lua')
-rw-r--r--util/pubsub.lua78
1 files changed, 77 insertions, 1 deletions
diff --git a/util/pubsub.lua b/util/pubsub.lua
index 08b77790..dc7c01e5 100644
--- a/util/pubsub.lua
+++ b/util/pubsub.lua
@@ -9,7 +9,83 @@ local default_config = {
itemcheck = function () return true; end;
get_affiliation = function () end;
normalize_jid = function (jid) return jid; end;
- capabilities = {};
+ capabilities = {
+ restricted = {
+ be_subscribed = false;
+ be_unsubscribed = true;
+ };
+ none = {
+ create = false;
+ publish = false;
+ retract = false;
+ get_nodes = true;
+
+ subscribe = true;
+ unsubscribe = true;
+ get_subscription = true;
+ get_subscriptions = true;
+ get_items = true;
+
+ subscribe_other = false;
+ unsubscribe_other = false;
+ get_subscription_other = false;
+ get_subscriptions_other = false;
+
+ be_subscribed = true;
+ be_unsubscribed = true;
+
+ set_affiliation = false;
+ };
+ publisher = {
+ create = false;
+ publish = true;
+ retract = true;
+ get_nodes = true;
+ get_configuration = true;
+
+ subscribe = true;
+ unsubscribe = true;
+ get_subscription = true;
+ get_subscriptions = true;
+ get_items = true;
+
+ subscribe_other = false;
+ unsubscribe_other = false;
+ get_subscription_other = false;
+ get_subscriptions_other = false;
+
+ be_subscribed = true;
+ be_unsubscribed = true;
+
+ set_affiliation = false;
+ };
+ owner = {
+ create = true;
+ publish = true;
+ retract = true;
+ delete = true;
+ get_nodes = true;
+ configure = true;
+ get_configuration = true;
+
+ subscribe = true;
+ unsubscribe = true;
+ get_subscription = true;
+ get_subscriptions = true;
+ get_items = true;
+
+
+ subscribe_other = true;
+ unsubscribe_other = true;
+ get_subscription_other = true;
+ get_subscriptions_other = true;
+
+ be_subscribed = true;
+ be_unsubscribed = true;
+
+ set_affiliation = true;
+ };
+ };
};
local default_config_mt = { __index = default_config };