09-29-2009 10:20 AM
if (me.isAdmin)
// if (me.options.currentUserRole !== undefined &&
// me.options.currentUserRole === "SiteManager")
{
this.isCurrentUserSiteAdmin = true;
}
09-30-2009 06:46 AM
09-30-2009 09:28 AM
That's client-side JavaScript, so unless you've passed the value in it doesn't have access to any "isAdmin" property. the usual "Share" way of doing this is to add it to the setOptions call in the Freemarker template and pick it up in the JavaScript from there ("me.options.isAdmin").
The reason the code isn't failing is because it's just being returned as "undefined" and so the if statement fails.
Thanks,
Mike
<#assign areAdmin = (user.name=='admin') />
isAdmin: areAdmin,
or maybeisAdmin: ${areAdmin},
<script type="text/javascript">//<![CDATA[
new Alfresco.SiteMembers("${args.htmlid}").setOptions(
{
siteId: "${page.url.templateArgs.site!""}",
currentUser: "${user.id}",
currentUserRole: "${currentUserRole}",
09-30-2009 11:23 AM
<script type="text/javascript">//<![CDATA[
new Alfresco.SiteMembers("${args.htmlid}").setOptions(
{
siteId: "${page.url.templateArgs.site!""}",
currentUser: "${user.id}",
currentUserRole: "${currentUserRole}",
isAdmin: ${user.isAdmin?string}
…
09-30-2009 01:05 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.