Phone Icon in CSM workspace

Community Alums
Not applicable

Hi All,

How to hide the phone icon in CSM workspace for particular group of users,even they had openframe role.

SobithaKaliap2_0-1687781362412.png

 

 

Thanks,

Sobitha

2 REPLIES 2

Peter Bodelier
Giga Sage

Hi @Community Alums,

 

What exactly are you trying to achieve, that you want to hide it?

Depending on your use case, it might be enough to configure which group uses the Openframe configuration.

 

Go to All> OpenFrame > Configurations, and set the group field to the group who should have access.


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

Community Alums
Not applicable

Hi @Peter Bodelier ,

For example, Group A has openframe role, Group B has not. Users who are part of group B should not have access to Openframe icon. Even though if the user is part of both groups, the icon should not be visible. In that case, OpenFrame configuration didn't work. So I changed the function getOpenFrameConfiguration() of OpenframeInteractionUtility script include.

getOpenFrameConfiguration: function() {
var ofSettings = {};
var flag = false;
var settings = new GlideRecord('sn_openframe_configuration');
var user = gs.getUser();
settings.addQuery('active', true);
settings.orderBy('order');
settings.query();
whileloop:
while (settings.next()) {
var groupIDs = settings.getValue('user_group');
if (groupIDs) {
var groupID = groupIDs.split(',');
for (var i = 0; i < groupID.length; i++) {
if (user.isMemberOf(groupID[i])) {
gs.info('Phone check');
flag = true;
break whileloop;
}
}
} else {
//  To make OpenFrame icon invisible for 'Gropu B' users
if(gs.getUser().isMemberOf('Group B'))
flag = false;
else
flag = true;
break whileloop;
}
}
if (flag) {
var config = {
title: settings.getValue('title'),
subTitle: settings.getValue('subtitle'),
titleIcon: settings.getValue('title_icon'),
url: settings.getValue('url'),
height: settings.getValue('height'),
width: settings.getValue('width'),
configuration: settings.getValue('configuration'),
collapsedViewEnabled: settings.getDisplayValue('collapsed_view_enabled'),
allow: gs.getProperty('sn_openframe.cross.origin.access', ''),
navIconClass: settings.getValue('icon_class')
};
ofSettings["config"] = config;
}
return this.encodeJson(ofSettings);
},

 

Now it works as Expected but not in workspace. Any suggestions on it?