main
 1using System.Security.Principal;
 2using gorilla.commons.utility;
 3
 4namespace MoMoney.Service.Infrastructure.Security
 5{
 6    public class IsInRole : Specification<IPrincipal>
 7    {
 8        readonly Role role;
 9
10        public IsInRole(Role role)
11        {
12            this.role = role;
13        }
14
15        public bool is_satisfied_by(IPrincipal item)
16        {
17            return item.IsInRole(role);
18        }
19    }
20}