diff options
author | Christophe Romain <christophe.romain@process-one.net> | 2013-06-06 11:11:37 +0200 |
---|---|---|
committer | Christophe Romain <christophe.romain@process-one.net> | 2013-06-06 11:11:37 +0200 |
commit | c8cba04f052a1a2ed977307e14b1775f574f6bcb (patch) | |
tree | f5f05e60bc76b06cad1ecaa353c002564b73b2fc /src/mod_pubsub/mod_pubsub_odbc.erl | |
parent | Handle multiple < and > in mod_muc_log plaintext mode (EJAB-1640) (diff) |
access_createnode acl also applies to auto created nodes ported to pubsub_odbc
Diffstat (limited to '')
-rw-r--r-- | src/mod_pubsub/mod_pubsub_odbc.erl | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/mod_pubsub/mod_pubsub_odbc.erl b/src/mod_pubsub/mod_pubsub_odbc.erl index 3396570a..d803395d 100644 --- a/src/mod_pubsub/mod_pubsub_odbc.erl +++ b/src/mod_pubsub/mod_pubsub_odbc.erl @@ -1633,7 +1633,7 @@ iq_pubsub(Host, ServerHost, From, IQType, SubEl, Lang, Access, Plugins) -> [#xmlel{name = <<"item">>, attrs = ItemAttrs, children = Payload}] -> ItemId = xml:get_attr_s(<<"id">>, ItemAttrs), - publish_item(Host, ServerHost, Node, From, ItemId, Payload); + publish_item(Host, ServerHost, Node, From, ItemId, Payload, Access); [] -> {error, extended_error(?ERR_BAD_REQUEST, <<"item-required">>)}; @@ -2610,8 +2610,10 @@ unsubscribe_node(Host, Node, From, Subscriber, SubId) -> | {error, xmlel()} ). publish_item(Host, ServerHost, Node, Publisher, <<>>, Payload) -> - publish_item(Host, ServerHost, Node, Publisher, uniqid(), Payload); + publish_item(Host, ServerHost, Node, Publisher, uniqid(), Payload, all); publish_item(Host, ServerHost, Node, Publisher, ItemId, Payload) -> + publish_item(Host, ServerHost, Node, Publisher, ItemId, Payload, all). +publish_item(Host, ServerHost, Node, Publisher, ItemId, Payload, Access) -> Action = fun (#pubsub_node{options = Options, type = Type, id = NodeId}) -> Features = features(Type), PublishFeature = lists:member(<<"publish">>, Features), @@ -2704,7 +2706,7 @@ publish_item(Host, ServerHost, Node, Publisher, ItemId, Payload) -> Type = select_type(ServerHost, Host, Node), case lists:member("auto-create", features(Type)) of true -> - case create_node(Host, ServerHost, Node, Publisher, Type) of + case create_node(Host, ServerHost, Node, Publisher, Type, Access, []) of {result, [#xmlel{name = <<"pubsub">>, attrs = [{<<"xmlns">>, ?NS_PUBSUB}], children = @@ -4238,9 +4240,6 @@ node_options(Type) -> jlib:binary_to_atom(<<(?PLUGIN_PREFIX)/binary, Type/binary>>), case catch Module:options() of -%% @spec (Host, Type, NodeId) -> [ljid()] -%% NodeId = pubsubNodeId() -%% @doc <p>Return list of node owners.</p> {'EXIT', {undef, _}} -> DefaultModule = jlib:binary_to_atom(<<(?PLUGIN_PREFIX)/binary, |