Forum Discussion
ChiaraS
10 years agoLithium Alumni (Retired)
You can also use REST v2 for that:
<#function user_has_role (id, roles)>
<#assign liql = "SELECT id FROM users WHERE roles.name IN (${roles}) and id = '${id}'" />
<#assign query = rest("2.0","/search?q=" + liql?url) />
<#if (query.status == "success") && query.data.size gt 0>
<#return true>
<#else>
<#return false>
</#if>
</#function>
and call it like this:
<#if user.registered && user_has_role(user.id,"'Administrator', 'Lithium'")> ... </#if>
yurikleban
10 years agoMentor
Thank you both for the info! Going to try it out for our personalized experience and will report back.
Cheers,
Yuri K.