08-25-2014 06:46 PM
<import resource="classpath:/alfresco/site-webscripts/org/alfresco/share/imports/share-header.lib.js">
model.jsonModel = {
rootNodeId: "share-header",
services: getHeaderServices(),
widgets: [
{
id: "SHARE_VERTICAL_LAYOUT",
name: "alfresco/layout/VerticalWidgets",
config:
{
widgets: getHeaderModel()
}
}
]
if (user.istest1)
{
widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_MY_FILES");
widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER ADMIN CONSOLE");
widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_REPOSITORY");
widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_PEOPLE");
widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_TASKS");
widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_SITES_MENU");
widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER SHARE FILES");
widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_HOME");
}
};
08-26-2014 04:35 PM
var widget, widgetsToRemove = [ "HEADER_SHARED_FILES", "HEADER_MY_FILES", "HEADER_PEOPLE", "HEADER_TASKS", "HEADER_REPOSITORY",
"HEADER_SEARCH", "HEADER_SITES_MENU" ], idx, max;
if (user.istest1);
for (idx = 0, max = widgetsToRemove.length; idx < max; idx++)
{ findAndRemoveIn(model.jsonModel.widgets, null, null, widgetsToRemove[idx]); }
function findAndRemoveIn(obj, arrContext, arrIdx, id)
{
var idx, max, key;
if (obj !== undefined && obj !== null)
{
if (Object.prototype.toString.apply(obj) === "[object Object]")
{
if (obj.hasOwnProperty("id") && obj.id === id)
{
if (arrContext !== null && arrIdx !== null)
{ arrContext.splice(arrIdx, 1); }
else
{ logger.debug("Unexpected match outside of array structure: " + jsonUtils.toJSONString(obj)); }
}
else
{
for (key in obj)
{
if (obj.hasOwnProperty(key))
{ findAndRemoveIn(obj[key], null, null, id); }
}
}
}
else if (Object.prototype.toString.apply(obj) === "[object Array]")
{
for (idx = 0, max = obj.length; idx < max; idx++)
{ findAndRemoveIn(obj[idx], obj, idx, id); }
}
}
}
08-28-2014 07:00 AM
08-28-2014 01:19 PM
if (user.nameistest1){ execute this block of code
function userlookup()
{
model.currentUserDetails = person.properties.userName;
}
if (person.properties.usernameistest1){
08-29-2014 02:55 PM
var widget, widgetsToRemove = [ "HEADER_SHARED_FILES", "HEADER_MY_FILES", "HEADER_PEOPLE", "HEADER_TASKS", "HEADER_REPOSITORY",
"HEADER_SEARCH", "HEADER_SITES_MENU" ], idx, max;
for (idx = 0, max = widgetsToRemove.length; idx < max; idx++)
findAndRemoveIn(model.jsonModel.widgets, null, null, widgetsToRemove[idx]);
function findAndRemoveIn(obj, arrContext, arrIdx, id){
{
var username = getUser (String, username);
getUser(String, username);
if (username == 'test1'){
var idx, max, key;
if (obj !== undefined && obj !== null)
{
if (Object.prototype.toString.apply(obj) === "[object Object]")
{
if (obj.hasOwnProperty("id") && obj.id === id)
{
if (arrContext !== null && arrIdx !== null)
{ arrContext.splice(arrIdx, 1); }
else
{ logger.debug("Unexpected match outside of array structure: " + jsonUtils.toJSONString(obj)); }
}
else
{
for (key in obj)
{
if (obj.hasOwnProperty(key))
{ findAndRemoveIn(obj[key], null, null, id); }
}
}
}
else if (Object.prototype.toString.apply(obj) === "[object Array]")
{
for (idx = 0, max = obj.length; idx < max; idx++)
{ findAndRemoveIn(obj[idx], obj, idx, id); }
}
}
}else {}
}
}
09-03-2014 04:39 AM
09-03-2014 11:30 AM
09-08-2014 12:15 PM
<?xml version="1.0"?>
<extension>
<modules>
<module>
<id>Remove Share Headers</id>
<version>1.0</version>
<description>Changes anyone in GROUP_parents</description>
<auto-deploy>true</auto-deploy>
<evaluator type="group.module.evaluator">
<params>
<groups>GROUP_parents</groups>
</params>
</evaluator>
<customizations>
<customization>
<targetPackageRoot>org.alfresco.share.header</targetPackageRoot>
<sourcePackageRoot>share-mod.remove-headers-link</sourcePackageRoot>
</customization>
</customizations>
</module>
</modules>
</extension>
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.