helpers.js 608 B

12345678910111213141516171819202122232425
  1. Meteor.startup(function () {
  2. // Helper names have to be well-formed JS identifiers, so they cannot use a
  3. // "namespace.symbol" format... but a "namespace$symbol" is usable.
  4. /**
  5. * @param {DrupalSSO} sso
  6. */
  7. Template.registerHelper('drupal_sso$userId', function (sso) {
  8. return sso.getUserId();
  9. });
  10. /**
  11. * @param {DrupalSSO} sso
  12. */
  13. Template.registerHelper('drupal_sso$userName', function (sso) {
  14. return sso.getUserName();
  15. });
  16. /**
  17. * @param {DrupalSSO} sso
  18. */
  19. Template.registerHelper('drupal_sso$userRoles', function (sso) {
  20. return sso.getUserRoles();
  21. });
  22. });