Skip to content

Hide Intercom messenger for certain roles. #24

@sgoudie

Description

@sgoudie

We only want a certain set of users within the app to be intercom customers (and hide the widget to others). Essentially, admins are allowed to use Intercom and count as intercom users, regular users don't.

I've tried disabling the messenger in Intercom and using the following in the layout.onRendered, but the widget still shows. Any ideas?

var userId = Meteor.userId();
var intercomUser = Roles.userIsInRole(userId, ['orgAdmin']);

  if (intercomUser) {
    IntercomSettings.widget = {
      activator: "#IntercomDefaultWidget"
    };
    console.log("Intercom user");
  } else {
    console.log("Not Intercom user");
  }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions