09-26-2013 10:26 AM
var userIsSiteManager=false;
var siteId=page.url.templateArgs.site;
var result = remote.call("/api/people/" + stringUtils.urlEncode(user.name) + "?groups=true");
var grps="";
if (result.status == 200 && result != "{}")
{
var theUser = eval('(' + result + ')');
var groups = theUser.groups;
for (var i=0; i < groups.length; i++) {
if (theUser.groups.itemName == "GROUP_site_"+siteId+"_SiteManager") userIsSiteManager = true;
}
}
10-01-2013 07:02 AM
var siteId = page.url.templateArgs.site || "";
model.userIsSiteManager= false;
if (siteId !== "")
{
var json = remote.call("/api/sites/" + siteId + "/memberships/" + encodeURIComponent(user.name));
if (json.status == 200)
{
var obj = eval('(' + json + ')');
if (obj)
{
model.userIsSiteManager= obj.role == "SiteManager";
}
}
}
10-01-2013 02:37 PM
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.