cancel
Showing results for 
Search instead for 
Did you mean: 

Limit Live search..

nokinha1
Confirmed Champ
Confirmed Champ

Hello!!

I need to limit a live search of some users and even groups... i'm editing a file share-header.get.js....

I removed other menus for user non admin, but in the search i need to limit it for groups or user... betters works for groups...

I'm try it..

if (!user.isAdmin)
{
widgetUtils.deleteObjectFromArray(model.jsonModel.widgets, "id", "HEADER_MY_FILES");
widgetUtils.deleteObjectFromArray(model.jsonModel.widgets, "id", "HEADER_PEOPLE");
widgetUtils.deleteObjectFromArray(model.jsonModel.widgets, "id", "HEADER_TASKS");
widgetUtils.deleteObjectFromArray(model.jsonModel.widgets, "id", "HEADER_SHARED_FILES");

};
//Hide Peoples to Search bar
var hidePeoples = widgetUtils.findObject(model.jsonModel.widgets, "id", "HEADER_SEARCH");
if (!group.isGROUP_SITE_CREATORS)
{
hidePeoples.config.showPeopleResults = false;
};

But the part "if (!group.isGROUP_SITE_CREATORS)" works bad... can anyone help me with this??

1 ACCEPTED ANSWER

kaynezhang
World-Class Innovator
World-Class Innovator

try

if(user.properties["alfUserGroups"].indexOf("**** group") != -1)

View answer in original post

2 REPLIES 2

kaynezhang
World-Class Innovator
World-Class Innovator

try

if(user.properties["alfUserGroups"].indexOf("**** group") != -1)

Thks sir!!! works fine!!!

If anyone want this...

I create GROUP_SITE_SEARCH and populate with peoples i'll not use a search...

var hidePeoples = widgetUtils.findObject(model.jsonModel.widgets, "id", "HEADER_SEARCH");

if(user.properties["alfUserGroups"].indexOf("GROUP_SITE_SEARCH") != -1)
{
hidePeoples.config.showPeopleResults = false;
hidePeoples.config.showDocumentResults = false;
//widgetUtils.deleteObjectFromArray(model.jsonModel.widgets, "id", "HEADER_SEARCH");
};