ProtectedContent + Branch

StatusIDPriorityType
Closed33795MajorQuestion
ProfileReply
gabossoloClient

Hi,

Based on my ticket: How to extend Branch with IXFEntityExtension.
I have ProtectedContent on row with Read not granted permission.

Could you please to hide these rows?

Thanks!

Replies

UserDescriptionPosted On
MariyaVoytovichAgent

Hello gabossolo!

I do not understand you.
You can provide us with screenshots or a demo project.

Regards,
Mariya
On behalf of Xafari Client Services Team

gabossoloClient

Please find attached screenshots.
Please let me know if you need a demo project.

Thank you!

MariyaVoytovichAgent

We need a demo project with your settings, reproducing the problem and detailed steps to reproduce the problem.

Regards,
Mariya
On behalf of Xafari Client Services Team

gabossoloClient

Working now! I've just added a View Controller to filter rows. Many thanks!

-----
public partial class BranchSupportLVRowsFilteringController : ObjectViewController
{
protected override void OnActivated()
{
base.OnActivated();
if (!SecuritySystem.IsAuthenticated) return;
if (XafariSecuritySystem.IsAdministrator(SecuritySystem.CurrentUser as ISecurityUserWithRoles)) return;
ApplyRowFilter();
}

private void ApplyRowFilter()
{
if (!(SecuritySystem.CurrentUser is IDCSecuritySystemUser currentUser)) return;
if (currentUser.Branches().BranchItems.Count <= 0) return;
var criterion = currentUser.Branches().BranchItems.Aggregate(null,
(current, branchItem) =>
CriteriaOperator.Or(current, new BinaryOperator("BranchCode", branchItem.Branch.Code)));

View.CollectionSource.BeginUpdateCriteria();
View.CollectionSource.Criteria.Clear();
View.CollectionSource.Criteria["BranchesOnlyFiltering"] = criterion;
View.CollectionSource.EndUpdateCriteria();
}
}

× This ticket is closed.

Write US