public

Only show cases with IsSensitive=false unless the current user has "View Sensitive Cases" permission

  • Download Gist
SensitiveCaseDataRestriction.cs
C#
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
using DovetailCRM.Core.Authorization;
using DovetailCRM.Core.Domain.Workflow;
using FubuFastPack.Querying;
using FubuMVC.Core.Security;
 
namespace DovetailCRM.Core.Web.Query
{
public class SensitiveCaseDataRestriction : IDataRestriction<Case>
{
public void Apply(IDataSourceFilter<Case> filter)
{
if (!PrincipalRoles.IsInRole(DomainActions.ViewSensitiveCases))
{
filter.WhereEqual(x => x.IsSensitive, false);
}
}
}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.