I have recently started learning backbone and aura and tried out a simple app using both. I have three widgets, say A, B and C. Now A and B publish events (using sandbox.emit) and C subscribes to them (using sandbox.on). 'A' publishes "A.eventA" and 'B' publishes "B.eventB" say. I tried publishing "B.eventB" from widget A and it still works. So, is there a way using which widgets cannot publish any events except there own events ? (Or is this allowed/expected behaviour ?)
Thanks.
What you're asking about is security. Aura's design is to have a facade that handles security. Instead of hitting the mediator's
publishdirectly, you call it through the facade. The facade first checks that you have permission to publish.Here's an example from https://gist.github.com/addyosmani/1518268 which shows security for
subscribe. You could use something similar forpublish.