Freemarker With Roles
I have a problem with a plug are not getting data from a function with freemarker.
My goal is to visualize the role of the user who entered the community and according to this display a banner.
However, this is only possible to be visible for users with administrator role.
I have new roles called Nivel_Test1, Nivel_Test2 and Nivel_Test3 only those roles are the ones that should be the banner but only manages to do with administrator and that's not what I want.
<#assign userStar = rest("2.0","/search?q=" + "SELECT roles FROM users WHERE login = '${user.login}'"?url) />
<#list userStar.data.items as usuario1>
<#assign roles1 = rest("2.0","/search?q=" + "${usuario1.roles.query}"?url) />
<#list roles1.data.items as role>
<#switch role.name>
<#case 'Nivel_Test1'>
<div class="banner_cr"><img src="
${asset.get("/html/assets/imagen.jpg")}" /></div>
<#break>
<#case 'Nivel_Test2'>
<div class="banner_cr"><img src="
${asset.get("/html/assets/imagen.jpg")}" /></div>
<#break>
<#case 'Nivel_Test3'>
<div class="banner_cr"><img src="
${asset.get("/html/assets/imagen.jpg")}" /></div>
<#break>
<#default>
<div></div>
</#switch>
</#list>
</#list>
Please Help Me :catembarrassed: