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.
if (me.isAdmin) // if (me.options.currentUserRole !== undefined && // me.options.currentUserRole === "SiteManager") { this.isCurrentUserSiteAdmin = true; }
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,
isAdmin: ${areAdmin},
<script type="text/javascript">//<![CDATA[ new Alfresco.SiteMembers("${args.htmlid}").setOptions( { siteId: "${page.url.templateArgs.site!""}", currentUser: "${user.id}", currentUserRole: "${currentUserRole}",
<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} …