1- // Copyright (C) 2011 Xtensive LLC.
2- // All rights reserved.
3- // For conditions of distribution and use, see license.
4- // Created by: Dmitri Maximov
5- // Created: 2011.05.30
6-
7- using System ;
8- using System . Linq ;
9- using Xtensive . Orm ;
10- using Xtensive . Orm . Security . Tests . Model ;
11- using Xtensive . Orm . Security . Tests . Permissions ;
12-
13- namespace Xtensive . Orm . Security . Tests . Roles
14- {
15- public class AutomobileManagerRole : EmployeeRole
16- {
17- private static IQueryable < Customer > GetCustomers ( ImpersonationContext context , QueryEndpoint query )
18- {
19- return query . All < Customer > ( )
20- . Where ( c => c . IsAutomobileIndustry ) ;
21- }
22-
23- protected override void RegisterPermissions ( )
24- {
25- RegisterPermission ( new CustomerPermission ( true , GetCustomers ) ) ;
26- }
27-
28- public AutomobileManagerRole ( Session session )
29- : base ( session )
30- {
31- }
32- }
1+ // Copyright (C) 2011 Xtensive LLC.
2+ // All rights reserved.
3+ // For conditions of distribution and use, see license.
4+ // Created by: Dmitri Maximov
5+ // Created: 2011.05.30
6+
7+ using System ;
8+ using System . Linq ;
9+ using Xtensive . Orm ;
10+ using Xtensive . Orm . Security . Tests . Model ;
11+ using Xtensive . Orm . Security . Tests . Permissions ;
12+
13+ namespace Xtensive . Orm . Security . Tests . Roles
14+ {
15+ public class AutomobileManagerRole : EmployeeRole
16+ {
17+ private static IQueryable < Customer > GetCustomers ( ImpersonationContext context , QueryEndpoint query )
18+ {
19+ return query . All < Customer > ( )
20+ . Where ( c => c . IsAutomobileIndustry ) ;
21+ }
22+
23+ protected override void RegisterPermissions ( )
24+ {
25+ RegisterPermission ( new CustomerPermission ( true , GetCustomers ) ) ;
26+ }
27+
28+ public AutomobileManagerRole ( Session session )
29+ : base ( session )
30+ {
31+ }
32+ }
3333}
0 commit comments