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");
}
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?