Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

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

View SensitiveCaseDataRestriction.cs
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);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.