Created
January 21, 2011 20:29
-
-
Save joshuaflanagan/790361 to your computer and use it in GitHub Desktop.
Only show cases with IsSensitive=false unless the current user has "View Sensitive Cases" permission
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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