As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
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>