2

I understand the security model of publish and subscribe.

But I'm working on a somewhat large application, of which perhaps 70% will be admin only, restricted to less than 1% of the user base.

It seems horrible to send all the templates, css, and extra javascript and "add ons" (like wysiwyg editor) which are only going to be used by the admins, to all app users.

Is there a way to only send clientside stuff to certain users (or only when the user triggers a different "section"?

If not, i think my only option would be to have two different meteor applications side-by-side, which both use the same database, but have completely different applications/interfaces/sessions. see 2 apps with same database

Any other suggestions/ideas?

Community
  • 1
  • 1
zeroasterisk
  • 2,199
  • 1
  • 23
  • 28

1 Answers1

3

A simple, but incomplete solution would be dynamically loading css and js dependencies at Template.mytemplate.created event. You'll still have shared html and packages code, but, depending on the application, it could be fine.

If you need more control over template dispatching this conversation at meteor talk group illustrates a couple of different solutions.

https://groups.google.com/forum/?fromgroups=#!searchin/meteor-talk/templates$2020/meteor-talk/F3DnoieDK00

Kyle Finley
  • 11,842
  • 6
  • 43
  • 64
handmade
  • 201
  • 3
  • 3
  • Thanks, that's an interesting approach and might end up being what I do... for now, I'm early in the project and have decided to segment admin to it's own app and share a db. Maybe I'll play with merging with your approach in a bit. – zeroasterisk Mar 29 '13 at 04:11