03-20-2014 07:40 AM
org.alfresco.service.cmr.site.SiteService.createSite=ACL_METHOD.ROLE_ADMINISTRATOR,ACL_METHOD.GROUP_SITECREATORS
var createSiteVisible = userHasGroup(user.name, 'SITECREATORS');
model.createSiteVisible = createSiteVisible;
function userHasGroup(username, group) {
var result = remote.call("/api/people/" + stringUtils.urlEncode(username) + "?groups=true");
if (result.status == 200 && result != "{}")
{
var user = eval('(' + result + ')');
var groups = new Array();
groups = user.groups;
var mygroups = "";
for (i=0; i<groups.length; i++)
{
if (groups.itemName == "GROUP_"+group || groups.itemName == "GROUP_ALFRESCO_ADMINISTRATORS"){
return true; // found group
}else{
mygroup = mygroups+groups.displayName;
}
}
return false;
}
else return false;
}
<#if createSiteVisible>
<span class="align-right yui-button-align">
<#if showCreateSite>
<span class="first-child">
<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>
</span>
</#if>
</span>
</#if>
03-21-2014 02:30 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.