Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Is it possible to negate 'Display to roles'? View modes: 
User avatar
Member
Member
Dlglsh - 9/20/2012 8:14:45 AM
   
Is it possible to negate 'Display to roles'?
Hi all,

I have a web part that I do not want to display to three roles. What is the best way to achieve this?

I can't think of how I can use the Edit input for 'Visible' or 'Display to roles' to write a macro expression to do this. I can do it for one role, using:

{% !CurrentUser.IsInRole("roleId"); %}


But how do I do it for three?

Thanks,

Matt

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 9/21/2012 2:09:54 AM
   
RE:Is it possible to negate 'Display to roles'?
Hi,

One option is to list all other roles in given setting.
Second option is to use K# macro where you can list all the user roles in an IF statement and return true/false.

Best regards,
Juraj Ondrus