public override string[] GetUsersInRole(string roleName)
 {
     RolesServices.RolesServiceSoapClient client =
         new RolesServices.RolesServiceSoapClient();
     client.ClientCredentials.Windows.AllowedImpersonationLevel =
         System.Security.Principal.TokenImpersonationLevel.Delegation;
     return client.GetUsersInRole(roleName, SYSTEM, SUBSYSTEM);
 }
 public override string[] GetRolesForUser(string username)
 {
     RolesServices.RolesServiceSoapClient client =
         new RolesServices.RolesServiceSoapClient();
     client.ClientCredentials.Windows.AllowedImpersonationLevel =
         System.Security.Principal.TokenImpersonationLevel.Delegation;
     return client.GetRolesForUser(username.Replace(@"SWN\", ""), SYSTEM, SUBSYSTEM);
 }
        private bool IsRecipientFinalApprover(System.Net.Mail.MailAddress recipient)
        {
            string recipientNetworkId = this.odsProvider.GetEmployeeByWorkEmailAddress(recipient.Address).NetworkId;
            RolesServices.RolesServiceSoapClient client =
                new RolesServices.RolesServiceSoapClient();
            client.ClientCredentials.Windows.AllowedImpersonationLevel =
                System.Security.Principal.TokenImpersonationLevel.Delegation;
            List<string> roles = new List<string>
                (client.GetRolesForUser(recipientNetworkId.Replace(@"SWN\", ""),
                System.Configuration.ConfigurationManager.AppSettings["MenuSystem"],
                System.Configuration.ConfigurationManager.AppSettings["MenuSubSystem"]));

            if (roles.Contains("FINAL"))
                return true;
            else
                return false;
        }