Prashant Mehta
Prashant Mehta

Reputation: 482

Macro condition to hide zone on the basis of document role

I am using a webpart-zone with two web parts in Kentico v7:

  1. Editable text
  2. Repeater

In the repeater I am using relationships to display data according to user's role and permissions assigned to it. It is working. I have put the condition in the webpart as:

{%CurrentDocument.RelatedDocuments.isrelatedto.Count>0#%}

I want to hide the complete zone, entire block, if there is no data. But the problem is that for some roles, the condition {%CurrentDocument.RelatedDocuments.isrelatedto.Count>0#%} returns true because it contain data but this should not be visible to the user as per his / her role permissions. In such a case it shows a blank web part. I don’t want to show this blank web part, I want to hide this completely.

What condition I should add for this? enter image description here

Upvotes: 1

Views: 929

Answers (1)

rocky
rocky

Reputation: 7696

This is quite specific need. I'd recommend creating your own macro method. There are detailed instructions in developer's guide regarding registration of such method. Your method would take the permissions into account and return true or false based on them.

Upvotes: 1

Related Questions