09-30-2012 11:47 PM
10-01-2012 08:18 AM
10-01-2012 02:33 PM
function main()
{
createSite = false
var result = remote.call("/api/people/" + stringUtils.urlEncode(user.name) + "?groups=true");
if (result.status == 200)
{
var i;
// Create javascript objects from the server response
// This is the User and it also contains all groups.
var userValue = eval('(' + result + ')');
if (userValue.groups.length != 0)
{
for (i = 0; i < userValue.groups.length; i++)
{
if (userValue.groups[i].itemName == "GROUP_ALFRESCO_ADMINISTRATORS") createSite = true;
if (userValue.groups[i].itemName == "GROUP_CreateSiteAdministrator") createSite = true;
}
}
}
// Check for IMAP server status
var result = remote.call("/imap/servstatus"),
imapServerEnabled = (result.status == 200 && result == "enabled");
// Prepare the model for the template
model.imapServerEnabled = imapServerEnabled;
model.createSite = createSite;
}
main();
<span class="first-child">
<#if createSite>
<a href="#" id="${id}-createSite-button" class="theme-color-1">
<img src="${url.context}/res/components/images/site-16.png" style="vertical-align: text-bottom" />
${msg("link.createSite")}</a>
</#if>
</span>
10-01-2012 10:05 PM
You can modify/override below files to hide create site link.
My Sites dashlet - site-webscripts/org/alfresco/components/dashlet/my-sites.get.html.ftl
Top header - site-webscripts/org/alfresco/modules/sites.get.html.ftl
Thanks,
10-01-2012 10:10 PM
A little more detail - in the js modulefunction main()
{
createSite = false
var result = remote.call("/api/people/" + stringUtils.urlEncode(user.name) + "?groups=true");
if (result.status == 200)
{
var i;
// Create javascript objects from the server response
// This is the User and it also contains all groups.
var userValue = eval('(' + result + ')');
if (userValue.groups.length != 0)
{
for (i = 0; i < userValue.groups.length; i++)
{
if (userValue.groups[i].itemName == "GROUP_ALFRESCO_ADMINISTRATORS") createSite = true;
if (userValue.groups[i].itemName == "GROUP_CreateSiteAdministrator") createSite = true;
}
}
}
// Check for IMAP server status
var result = remote.call("/imap/servstatus"),
imapServerEnabled = (result.status == 200 && result == "enabled");
// Prepare the model for the template
model.imapServerEnabled = imapServerEnabled;
model.createSite = createSite;
}
main();
then in the HTML file<span class="first-child">
<#if createSite>
<a href="#" id="${id}-createSite-button" class="theme-color-1">
<img src="${url.context}/res/components/images/site-16.png" style="vertical-align: text-bottom" />
${msg("link.createSite")}</a>
</#if>
</span>
02-03-2016 08:25 AM
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.