Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > Custom Security Around WebParts View modes: 
User avatar
Member
Member
kevmiller77-googlemail - 8/12/2009 9:49:24 AM
   
Custom Security Around WebParts
Hi,

I've been looking into how to implement custom security around web parts and cannot seem to find any examples on how to use the DisplayToRoles property on a web part. Is this a comma or | delimited string?

Is there any other way in which custom security can be applied through web parts or ASPX templates?

Thanks for any help,

Kev

User avatar
Kentico Consulting
Kentico Consulting
kentico_mirekr - 8/13/2009 8:28:20 AM
   
RE:Custom Security Around WebParts
Hi,

You need to use semicolons to separate roles in this property. Example:

DisplayToRoles="SilverPartners;CMSEditor"


You can alo check current user role and according this role set visibility of your web part/control:

bool CMS.CMSHelper.CMSContext.CurrentUser.IsInRole(string roleName, string SiteName)


Best Regards,
Miroslav Remias.