Check the “words” that pass here, shorthands like “~site” will already be expanded here.
In your case you can match on: [<<“site”>>, _Site, <<“flight”>> | _] But returning true here will indeed allow any user to publish or subscribe to these topics. - Marc > On 30 Nov 2016, at 15:30, heiheshang <[email protected]> wrote: > > observe_acl_is_allowed(#acl_is_allowed{action=publish, > object=#acl_mqtt{words=[<<"~site">>, <<"flight">>| _Rest]}}, Context) > -> > true; > observe_acl_is_allowed(#acl_is_allowed{action=subscribe, > object=#acl_mqtt{words=[<<"~site">>, <<"flight">>| _Rest]}}, Context) > -> > true; > > as well give right? > > > суббота, 26 ноября 2016 г., 17:08:44 UTC+9 пользователь heiheshang написал: > Yes I can change the context, but not anyone can get this message, only now > the administrator can > > суббота, 26 ноября 2016 г., 16:35:59 UTC+9 пользователь Marc Worrell написал: > Quick reply, as I am away from my keyboard. > > MQTT messages are ACL checked by topic. You can check mod_mqtt for an example > observer. > > If you just want to publish from Erlang, then you can use z_acl:sudo/1 on the > Context. This switches off ACL checks. > > - Marc > > Sent from my iPhone > > On 26 Nov 2016, at 03:49, heiheshang <[email protected] <>> wrote: > >> how to set the right user to send messages to z_mqtt. >> I found that the average user of this site can not send messages >> >> -- >> >> --- >> You received this message because you are subscribed to the Google Groups >> "Zotonic developers" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <>. >> For more options, visit https://groups.google.com/d/optout >> <https://groups.google.com/d/optout>. > > > -- > > --- > You received this message because you are subscribed to the Google Groups > "Zotonic developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. -- --- You received this message because you are subscribed to the Google Groups "Zotonic developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
