Comparison

plugins/mod_pubsub/mod_pubsub.lua @ 9158:37e814a680ab

mod_pubsub, mod_pep, util.pubsub: Move capability definitions into util.pubsub to avoid duplication
author Matthew Wild <mwild1@gmail.com>
date Wed, 08 Aug 2018 20:48:02 +0100
parent 9139:24a1e7a9d463
child 9179:82fad995a149
comparison
equal deleted inserted replaced
9157:c517a219f2ac 9158:37e814a680ab
170 170
171 function module.load() 171 function module.load()
172 if module.reloading then return; end 172 if module.reloading then return; end
173 173
174 set_service(pubsub.new({ 174 set_service(pubsub.new({
175 capabilities = {
176 restricted = {
177 be_subscribed = false;
178 be_unsubscribed = true;
179 };
180 none = {
181 create = false;
182 publish = false;
183 retract = false;
184 get_nodes = true;
185
186 subscribe = true;
187 unsubscribe = true;
188 get_subscription = true;
189 get_subscriptions = true;
190 get_items = true;
191
192 subscribe_other = false;
193 unsubscribe_other = false;
194 get_subscription_other = false;
195 get_subscriptions_other = false;
196
197 be_subscribed = true;
198 be_unsubscribed = true;
199
200 set_affiliation = false;
201 };
202 publisher = {
203 create = false;
204 publish = true;
205 retract = true;
206 get_nodes = true;
207 get_configuration = true;
208
209 subscribe = true;
210 unsubscribe = true;
211 get_subscription = true;
212 get_subscriptions = true;
213 get_items = true;
214
215 subscribe_other = false;
216 unsubscribe_other = false;
217 get_subscription_other = false;
218 get_subscriptions_other = false;
219
220 be_subscribed = true;
221 be_unsubscribed = true;
222
223 set_affiliation = false;
224 };
225 owner = {
226 create = true;
227 publish = true;
228 retract = true;
229 delete = true;
230 get_nodes = true;
231 configure = true;
232 get_configuration = true;
233
234 subscribe = true;
235 unsubscribe = true;
236 get_subscription = true;
237 get_subscriptions = true;
238 get_items = true;
239
240
241 subscribe_other = true;
242 unsubscribe_other = true;
243 get_subscription_other = true;
244 get_subscriptions_other = true;
245
246 be_subscribed = true;
247 be_unsubscribed = true;
248
249 set_affiliation = true;
250 };
251 };
252
253 autocreate_on_publish = autocreate_on_publish; 175 autocreate_on_publish = autocreate_on_publish;
254 autocreate_on_subscribe = autocreate_on_subscribe; 176 autocreate_on_subscribe = autocreate_on_subscribe;
255 177
256 nodestore = node_store; 178 nodestore = node_store;
257 itemstore = create_simple_itemstore; 179 itemstore = create_simple_itemstore;