12-06-2010 05:11 AM
var userIsSiteManager = true;
//Check whether we are within the context of a site
if (url.templateArgs.site)
{
//If we are, call the repository to see if the user is site manager or not
userIsSiteManager = false;
var obj = context.properties["memberships"];
if (!obj)
{
var json = remote.call("/api/sites/" + page.url.templateArgs.site + "/memberships/" + stringUtils.urlEncode(user.name));
if (json.status == 200)
{
obj = eval('(' + json + ')');
}
}
if (obj)
{
userIsSiteManager = (obj.role == "SiteManager");
}
}
model.userIsSiteManager = userIsSiteManager;
<div class="dashlet myDashlet">
<div class="title">
<a id="${args.htmlid}-title-link"
class="title-link theme-color-5">${msg('label.header')}</a>
<#if userIsSiteManager>
<a id="${args.htmlid}-myDashletConfig-link" class="configure theme-color-5" href="#">${msg("label.configure")}</a>
</#if>
<span> </span>
</div>
[…]
</div>
12-06-2010 05:57 AM
12-06-2010 07:32 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.