Forum Discussion
skylinegtr - You need to make this edit:
<#if user_has_role?? && (user_has_role == "admin") || user_has_role?? && (user_has_role == "partner") || user_has_role?? && (user_has_role == "customer")>
If you need to remove customer role, or partner role, remove red or green text respectively.
I hope this helps.
VarunGrazitti-thanks for your help.
It's strange, when I removed the customer role
<#if user_has_role?? && (user_has_role == "admin") || user_has_role?? && (user_has_role == "partner")>
<li><a class="second" href="#">Partner Portal</a></li>
</#if>
the Partner Portal text doesn't appear when I logged in as a admin or a Partner. If I add the customer role back, it appears.
This is how I've setup the roles:
<#assign user_has_role = "none" />
<#list restadmin("/users/id/${user.id?c}/roles").roles.role as role>
<#if role.name?? && ((role.name == "Customer"))>
<#assign user_has_role = "customer" />
<#break />
<#elseif role.name?? && ((role.name == "Partner")||(role.name =="Support Providers"))>
<#assign user_has_role = "partner" />
<#elseif role.name?? && ((role.name == "Employee"))>
<#assign user_has_role = "employee" />
<#elseif role.name?? && ((role.name == "Support Staff"))>
<#assign user_has_role = "support" />
<#elseif role.name?? && ((role.name == "SupportOps"))>
<#assign user_has_role = "SupportOps" />
<#elseif role.name?? && ((role.name == "Registered User"))>
<#assign user_has_role = "reguser" />
<#elseif role.name?? && ((role.name == "Visitor"))>
<#assign user_has_role = "visitor" />
<#elseif role.name?? && ((role.name == "Administrator"))>
<#assign user_has_role = "admin" />
</#if>
</#list>
Related Content
- 12 months ago
- 2 years ago