08-17-2020 08:09 PM
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??
08-17-2020 09:34 PM
08-17-2020 09:34 PM
try
if(user.properties["alfUserGroups"].indexOf("**** group") != -1)
08-17-2020 11:18 PM
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");
};
Explore our Alfresco products with the links below. Use labels to filter content by product module.