Limit Live search..

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Active Member II

Limit Live search..

Jump to solution

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 Solution

Accepted Solutions
Highlighted
Intermediate II

Re: Limit Live search..

Jump to solution

try

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

View solution in original post

2 Replies
Highlighted
Intermediate II

Re: Limit Live search..

Jump to solution

try

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

View solution in original post

Highlighted
Active Member II

Re: Limit Live search..

Jump to solution

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